-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Adam implementation minor fix #23737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for the fix @farhadrgh! |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yf225 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
torch/csrc/api/src/optim/adam.cpp
Outdated
| .addcmul_(p.grad(), p.grad(), 1 - options.beta2_); | ||
|
|
||
| Tensor denom = exp_average_sq; | ||
| Tensor denom = exp_average_sq / bias_correction2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arguably this should be in an else block to avoid computation when options.amsgrad_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed declaration in 72c6582.
vincentqb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please confirm that line 43 is indeed correct.
vincentqb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me!
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vincentqb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@vincentqb merged this pull request in ab15d38. |
This PR is in accordance with #22628
I had submitted the PR for
adam.pyandadamw.pybut had forgotten about theadam.cpp.