-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Make reduce_on_plateau more flexible #5918
Comments
@alexander-soare I am not completly sure what the problem is as the lightning internals scheduler['reduce_on_plateau'] = isinstance(
scheduler['scheduler'], optim.lr_scheduler.ReduceLROnPlateau
) should set w = WarmupReduceLROnPlateau(torch.optim.Adam(torch.nn.Parameter([1])))
isinstance(w, ReduceLROnPlateau) # True |
@SkafteNicki ah yes you're right, because here I subclass |
So historically, we have only supported pytorch schedulers (meaning schedulers subclassing |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
Hi, I have a ame request for the feature. and it seems have not been supported in 1.4.1 |
🚀 Feature
I want to have freedom to use a custom reduce on plateau type scheduler.
Motivation
Right now, only
torch.optim.lr_scheduler.ReduceLROnPlateau
is supported out of the box. See here. This means even if I specify{'reduce_on_plateau': True}
in:this will be overridden downstream.
Pitch
At the very least
TrainerOptimizersMixin.configure_schedulers
should check to see if the key was provided, and if so, don't overwrite it. So I propose changingto
But in the long run I'd suggest we allow the user to override a method of
Trainer
like this:That way we could access the variables needed and provide our own signature to the
step
method of the scheduler class.Additional context
My particular custom scheduler looks like
If this gets any traction I'd love to contribute a PR (would be my first to a widely used repo!)
The text was updated successfully, but these errors were encountered: