Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Lr scheduler bug #2905

Merged
merged 10 commits into from
Jul 12, 2019
Merged

Lr scheduler bug #2905

merged 10 commits into from
Jul 12, 2019

Conversation

codedecde
Copy link
Contributor

Fixes #2895
Couple of things that I would like to discuss

  • Currently, the design makes it necessary to specify the mode while using the reduce_on_plateau scheduler, unless its specified in a trainer (in which case the mode is set automatically, based on the validation metric)
  • If the metric and the mode do not match, currently the code uses a logger.warning instead of an exception. Can change that to be an exception.

Copy link
Contributor

@DeNeutoy DeNeutoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR + thorough tests!

allennlp/training/util.py Show resolved Hide resolved
allennlp/training/trainer.py Outdated Show resolved Hide resolved
@codedecde
Copy link
Contributor Author

Is it okay for it to be a logger warning when the metrics and mode don't agree in update_scheduler_params (allennlp/training/util.py, line 455), or should that be a configuration Error ?

@matt-gardner
Copy link
Contributor

@DeNeutoy, is this good to merge?

@brendan-ai2
Copy link
Contributor

@DeNeutoy ping. Thanks.

@brendan-ai2
Copy link
Contributor

@codedecde , sorry for letting this slip through the cracks. I've given this another skim and based on that plus @DeNeutoy's previous approval I'm going to merge.

Regarding your specific question on the configuration error/warning distinction (allennlp/training/util.py, line 455), I'd be partial to a hard error, but I don't think that needs to hold up merging this PR. Feel free to add that in a followup PR if you feel strongly.

Thanks for your contribution!

@brendan-ai2 brendan-ai2 merged commit 083f343 into allenai:master Jul 12, 2019
Whu-wxy added a commit to Whu-wxy/allennlp that referenced this pull request Jul 13, 2019
DeNeutoy added a commit that referenced this pull request Jul 15, 2019
reiyw pushed a commit to reiyw/allennlp that referenced this pull request Nov 12, 2019
Fixes allenai#2895 
Couple of things that I would like to discuss

- Currently, the design makes it necessary to specify the mode while using the reduce_on_plateau scheduler, unless its specified in a trainer (in which case the mode is set automatically, based on the validation metric)
- If the metric and the mode do not match, currently the code uses a logger.warning instead of an exception. Can change that to be an exception.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReduceLROnPlateau mode be faithful to the validation metric passed
5 participants