Skip to content

Allow log_momentum for adaptive optimizers#5333

Merged
rohitgr7 merged 10 commits intomasterfrom
bugfix/lr_monitor_mom
Jan 5, 2021
Merged

Allow log_momentum for adaptive optimizers#5333
rohitgr7 merged 10 commits intomasterfrom
bugfix/lr_monitor_mom

Conversation

@rohitgr7
Copy link
Copy Markdown
Contributor

@rohitgr7 rohitgr7 commented Jan 2, 2021

What does this PR do?

Fixes #5330

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes [if needed]?
  • Did you write any new necessary tests [no need for typos, docs]?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Check that target branch and milestone are aligned!

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 2, 2021

Codecov Report

Merging #5333 (052b15a) into master (15a400b) will decrease coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #5333   +/-   ##
======================================
- Coverage      93%     93%   -0%     
======================================
  Files         134     134           
  Lines        9950    9951    +1     
======================================
- Hits         9261    9255    -6     
- Misses        689     696    +7     

@rohitgr7 rohitgr7 added this to the 1.1.x milestone Jan 2, 2021
@rohitgr7 rohitgr7 added bug Something isn't working logging Related to the `LoggerConnector` and `log()` labels Jan 2, 2021
@rohitgr7 rohitgr7 marked this pull request as ready for review January 2, 2021 20:06
Copy link
Copy Markdown
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

an idea for the future: allow the user to pass in functions / lambdas for extracting the learning rate, momentum or whatever required by the monitor. This way we can support all optimizers in a generic way and for the known ones, we provide the default functions. :)

Comment thread pytorch_lightning/callbacks/lr_monitor.py Outdated
Comment thread pytorch_lightning/callbacks/lr_monitor.py Outdated
Comment thread tests/callbacks/test_lr_monitor.py Outdated
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Comment thread tests/callbacks/test_lr_monitor.py Outdated
Comment thread tests/callbacks/test_lr_monitor.py Outdated
Comment thread pytorch_lightning/callbacks/lr_monitor.py Outdated
Comment thread pytorch_lightning/callbacks/lr_monitor.py Outdated
Copy link
Copy Markdown
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Outside of @carmocca comments, it looks good !

@rohitgr7 rohitgr7 requested a review from carmocca January 4, 2021 19:23
@rohitgr7 rohitgr7 enabled auto-merge (squash) January 4, 2021 19:24
Comment thread pytorch_lightning/callbacks/lr_monitor.py Outdated
Comment thread tests/callbacks/test_lr_monitor.py Outdated
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Comment thread tests/callbacks/test_lr_monitor.py Outdated
Copy link
Copy Markdown
Collaborator

@Borda Borda left a comment

Choose a reason for hiding this comment

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

lgtm 🐰

@rohitgr7 rohitgr7 added the ready to be merged PRs ready to be merged label Jan 4, 2021
@rohitgr7 rohitgr7 merged commit 371daea into master Jan 5, 2021
@rohitgr7 rohitgr7 deleted the bugfix/lr_monitor_mom branch January 5, 2021 06:51
Borda pushed a commit that referenced this pull request Jan 6, 2021
* fix

* fix

* chlog

* no momentum warning

* Apply suggestions from code review

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* ref

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

(cherry picked from commit 371daea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working logging Related to the `LoggerConnector` and `log()` ready to be merged PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logging momentum in LearningRateMonitor

5 participants