Support L2 regularization and decoupled weight decay in rowwise adagrad#718
Open
yuxihu wants to merge 1 commit intopytorch:mainfrom
Open
Support L2 regularization and decoupled weight decay in rowwise adagrad#718yuxihu wants to merge 1 commit intopytorch:mainfrom
yuxihu wants to merge 1 commit intopytorch:mainfrom
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D31285351 |
yuxihu
pushed a commit
to yuxihu/FBGEMM
that referenced
this pull request
Oct 5, 2021
…ad (pytorch#718) Summary: Pull Request resolved: pytorch#718 Add two kinds of weight decay in rowwise adagrad: L2 regularization: ``` g' = g + weight_decay * w multiplier = lr / (sqrt(v) + eps) w = w - lr * g' / (sqrt(v) + eps) = w - lr * g / (sqrt(v) + eps) - lr * weight_decay * w / (sqrt(v) + eps) = (1 - multiplier * weight_decay) * w - multiplier * g ``` Decoupled weight decay: ``` multiplier = lr / (sqrt(v) + eps) w = w - lr * (g / (sqrt(v) + eps) + weight_decay * w) = w - lr * g / (sqrt(v) + eps) - lr * weight_decay * w = (1 - lr * weight_decay) * w - multiplier * g ``` Reviewed By: choudharydhruv Differential Revision: D31285351 fbshipit-source-id: 7ee3cf014fff05d837d34ec0c2b67e189272f502
15f451a to
4ee9b29
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D31285351 |
…ad (pytorch#718) Summary: Pull Request resolved: pytorch#718 Add two kinds of weight decay in rowwise adagrad: L2 regularization: ``` g' = g + weight_decay * w multiplier = lr / (sqrt(v) + eps) w = w - lr * g' / (sqrt(v) + eps) = w - lr * g / (sqrt(v) + eps) - lr * weight_decay * w / (sqrt(v) + eps) = (1 - multiplier * weight_decay) * w - multiplier * g ``` Decoupled weight decay: ``` multiplier = lr / (sqrt(v) + eps) w = w - lr * (g / (sqrt(v) + eps) + weight_decay * w) = w - lr * g / (sqrt(v) + eps) - lr * weight_decay * w = (1 - lr * weight_decay) * w - multiplier * g ``` Reviewed By: choudharydhruv Differential Revision: D31285351 fbshipit-source-id: e361627f8426856021badef0410455e23620f21b
4ee9b29 to
303cc2f
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D31285351 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add two kinds of weight decay in rowwise adagrad:
L2 regularization:
Decoupled weight decay:
Reviewed By: choudharydhruv
Differential Revision: D31285351