Skip to content
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

Fixed AdamWeightDecayOptimizer usage code #147

Open
jinamshah opened this issue Jul 9, 2019 · 0 comments
Open

Fixed AdamWeightDecayOptimizer usage code #147

jinamshah opened this issue Jul 9, 2019 · 0 comments

Comments

@jinamshah
Copy link

@zihangdai @kimiyoung
I have raised a PR for this:
#146

What is affected by this issue:
Because of this piece of code, the model will kep training on step 0 if AdamWeightDecayOptimizer is used with TPU
Made changes to the code here.
This was done because when the code reaches the said line, the optimizer is not necessarily a AdamWeightDecayOptimizer object. It can be a CrossShardOptimizer object.
Thus, by change checking if the weight_decay flag is not equal to zero, we can conclusively say if the optimizer uses Adam weight decay or not.

Note: if FLAGS.weight_decay != 0 can be changed to if not FLAGS.weight_decay but that would hinder the code if someone has used None by mistake

Please let me know if any other changes are required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant