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

Add eps and amsgrad options to Adam Optimizer #600

Merged
merged 3 commits into from
Dec 31, 2022

Conversation

zeyugao
Copy link
Contributor

@zeyugao zeyugao commented Dec 31, 2022

Expose more options in AdamOptions

Fix #145

However it will break the adamw and adam interface under src/nn/optimizer.rs. Should I create a new functions like adam_new?

@LaurentMazare
Copy link
Owner

Thanks for the PR, I've made further changes to preserve the current api and the newly added field can still be configured via a builder pattern. I think I'll lilkely remove the nn::adam and nn::adamw functions altogether as the intended way to setup the optimizer would be as follows, though I want to think a bit more about it before removing these.

let opt = Adam::default().eps(1e-6).amsgrad(true).build_copt(...)

@LaurentMazare LaurentMazare merged commit c0bb7e7 into LaurentMazare:main Dec 31, 2022
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

Successfully merging this pull request may close these issues.

Does Adam optimizer missing eps field?
2 participants