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

Adjusting optimizer learning rates on-the-fly #233

Closed
staticfloat opened this issue Apr 13, 2018 · 3 comments
Closed

Adjusting optimizer learning rates on-the-fly #233

staticfloat opened this issue Apr 13, 2018 · 3 comments

Comments

@staticfloat
Copy link
Contributor

It would be great to allow the Flux optimizers to have parameters that can be tweaked from the outside. As an example, I would like to have an SGD where I can tune the learning rate over time. I could do this by destroying the optimizer and recreating it every epoch, (which is fine for SGD) but that hurts performance with optimizers that keep running estimates of gradient magnitude such as ADAM or RMSProp.

@tejank10
Copy link
Contributor

tejank10 commented Apr 13, 2018

I am thinking of treating the optimizers as structs rather than functions. For example, ADAM will be a struct having learning rate, momentum, velocity etc. as its fields. And there can be an update function which takes this struct and performs the update, thereby updating the momentum and velocity. In this way, we'll be able to mutate the learning rate.

@iblislin
Copy link
Contributor

iblislin commented Apr 17, 2018

Currently, I tweak learning rate via opening the training loop and changing the Δ of back!(loss, Δ).

@MikeInnes
Copy link
Member

Fixed by #379.

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

4 participants