This repository was archived by the owner on Jan 15, 2024. It is now read-only.
[FEATURE] Add "Reduce LR On Plateau" scheduler #897
Open
haven-jeon wants to merge 2 commits intodmlc:v0.xfrom
Open
[FEATURE] Add "Reduce LR On Plateau" scheduler #897haven-jeon wants to merge 2 commits intodmlc:v0.xfrom
haven-jeon wants to merge 2 commits intodmlc:v0.xfrom
Conversation
Member
|
Job PR-897/1 is complete. |
szhengac
reviewed
Aug 27, 2019
| else: # mode == 'max': | ||
| self.mode_worse = -np.Inf | ||
|
|
||
| self.is_better = partial(self._cmp, mode, threshold_mode, threshold) |
Member
There was a problem hiding this comment.
Why do you want to use partial? mode, threshold_mode, threshold are simply class variables, so you can simply use them by adding self. to the prefix.
| def in_cooldown(self): | ||
| return self.cooldown_counter > 0 | ||
|
|
||
| def _cmp(self, mode, threshold_mode, threshold, a, best): |
Member
There was a problem hiding this comment.
The current design does not look very scalable. That means it requires hard coding if we would like add some changes/schedules.
Member
Author
There was a problem hiding this comment.
Thanks for the comments.
I can consider more flexible class desine.
Member
|
@haven-jeon gentle ping |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
The LR scheduler that reduce learning rate when a metric has stopped improving. #887
Modified code from https://pytorch.org/docs/stable/optim.html#torch.optim.lr_scheduler.ReduceLROnPlateau
Checklist
Essentials
Changes
Comments