Early stopping and other parameters for learning rate scheduler#184
Merged
kathyxchen merged 2 commits intoFunctionLab:masterfrom Sep 19, 2022
Merged
Early stopping and other parameters for learning rate scheduler#184kathyxchen merged 2 commits intoFunctionLab:masterfrom
kathyxchen merged 2 commits intoFunctionLab:masterfrom
Conversation
Collaborator
|
Thanks so much for this PR @rfriedman22 ! Is there an example you can add to |
Contributor
Author
|
Sorry for the delay @kathyxchen -- it's been a busy time lately. I've added an example config to this PR that demonstrates the new features :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #183
What does this implement/fix? Explain your changes.
ReduceLROnPlateau. TheTrainModelobject has a new argumentscheduler_kwargsthat defaults to the pre-existing default parameters. User can specify other parameters as a dictionary, including through YAML config files. The kwargs get passed to the_init_trainmethod when the scheduler is created. Support for other types of schedulers was not added.TrainModelobject has a new optional argumentstopping_criteria. If specified, it is a list that must correspond to the metric and patience for stopping criteria. Whenvalidateis called, it checks to see the last time the specified metric improves on the validation set. If the metric has not improved in the specified patience period, then the logger reports a debug message that early stopping has been reached and the for loop intrain_and_validateis terminated.What testing did you do to verify the changes in this PR?
TrainModelobjects from YAML config files that contain the new arguments. Verified thescheduleris assigned parameters specified in the config. Verified the early stopping criteria gets set as internal variables.