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

Adding support for the CosineAnnealingWarmRestarts scheduler #2851

Closed
wants to merge 5 commits into from

Conversation

Alicegaz
Copy link

@Alicegaz Alicegaz commented Aug 6, 2020

Fixes #2849

Seems like there is currently no support for the schedulers taking values to the step function.
This commit adds support for any scheduler (not particularly ReduceOnPlateau scheduler) taking in validation metrics value/epoch/step_progress.

Step progress is a float value that CosineAnnealingWarmRestarts scheduler takes in cases when a step function is called after each step, which is found as current_epoch+batch_idx/num_training_batches.

Now, the 'monitor' attribute in the schedulers dictionary can also take strings 'epoch' and 'iter_frac' (denotes step progress). As there will be the need for other input values, the dictionary of additional 'monitor' keys and short lambda functions implementing their computation can be extended or moved to the utils section.

@pep8speaks
Copy link

pep8speaks commented Aug 6, 2020

Hello @Alicegaz! Thanks for updating this PR.

Line 272:42: E127 continuation line over-indented for visual indent
Line 274:34: E127 continuation line over-indented for visual indent
Line 274:58: E225 missing whitespace around operator

Comment last updated at 2020-08-10 11:40:06 UTC

@mergify mergify bot requested a review from a team August 6, 2020 12:18
@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #2851 into master will decrease coverage by 55%.
The diff coverage is 20%.

@@           Coverage Diff            @@
##           master   #2851     +/-   ##
========================================
- Coverage      90%     36%    -55%     
========================================
  Files          78      78             
  Lines        7004    6927     -77     
========================================
- Hits         6321    2466   -3855     
- Misses        683    4461   +3778     

@Borda Borda added the feature Is an improvement or enhancement label Aug 6, 2020
@Borda Borda added this to the 0.9.0 milestone Aug 6, 2020
Copy link
Member

@SkafteNicki SkafteNicki left a comment

Choose a reason for hiding this comment

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

A few comment, PR is looking good.
Please also solve the pep issues.

@mergify mergify bot requested a review from a team August 7, 2020 09:05
@awaelchli
Copy link
Contributor

@ananyahjha93 You might want to take a look at this since you recently added a scheduler to bolts.
Lightning-Universe/lightning-bolts#138

@mergify
Copy link
Contributor

mergify bot commented Aug 8, 2020

This pull request is now in conflict... :(

@awaelchli awaelchli modified the milestones: 0.9.0, 1.0.0 Aug 8, 2020
@ananyahjha93 ananyahjha93 self-requested a review August 9, 2020 11:22
Copy link
Contributor

@ananyahjha93 ananyahjha93 left a comment

Choose a reason for hiding this comment

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

Blocking this PR for now. @Alicegaz This is still up for discussion: #2849

@mergify mergify bot requested a review from a team August 9, 2020 18:05
@ananyahjha93
Copy link
Contributor

@Alicegaz closing this PR now, based on the discussions in #2849, we don't think this is the right way to go.

@edenlightning
Copy link
Contributor

@ananyahjha93 what's the decision here?

@stale
Copy link

stale bot commented Nov 3, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://pytorch-lightning.readthedocs.io/en/latest/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Slack. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Nov 3, 2020
@stale
Copy link

stale bot commented Nov 8, 2020

This pull request is going to be closed. Please feel free to reopen it create a new from the actual master.

@stale stale bot closed this Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement won't fix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Scheduler taking a value to the step function
8 participants