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

Changed LearningRateLogger to LearningRateMonitor #3251

Merged
merged 8 commits into from
Sep 3, 2020

Conversation

rohitgr7
Copy link
Contributor

What does this PR do?

Changed LearningRateLogger to LearningRateMonitor. Discussion: #3008 (comment)

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? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • 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.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@mergify mergify bot requested a review from a team August 28, 2020 20:59
@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #3251 into master will increase coverage by 0%.
The diff coverage is 97%.

@@          Coverage Diff           @@
##           master   #3251   +/-   ##
======================================
  Coverage      90%     90%           
======================================
  Files          90      91    +1     
  Lines        8138    8143    +5     
======================================
+ Hits         7349    7355    +6     
+ Misses        789     788    -1     

@awaelchli
Copy link
Contributor

awaelchli commented Aug 29, 2020

@rohitgr7 I think we need to make sure that LearningRateLogger can still be used, so maybe subclass

class LearningRateLogger(LearningRateMonitor):
    def __init__(self, *args, **kwargs)
        # print a deprecation warning here
        rank_zero_warn(...)
        super().__init__(*args, **kwargs)

@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Aug 29, 2020

Also, should we consider the row_log_interval here, just like with usual logs?

Copy link
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.

LGTM, maybe ask @Borda to check deprecation stuff :)

@awaelchli
Copy link
Contributor

Also, should we consider the row_log_interval here, just like with usual logs?

probably, yes, in new PR?

@mergify mergify bot requested a review from a team August 29, 2020 18:56
@Borda
Copy link
Member

Borda commented Aug 29, 2020

LGTM, maybe ask @Borda to check deprecation stuff :)

yeah, this will be quite tricky, there are a few things you need to do:

  • keep the original file and reimport from new.package.path import NewClass as OldClass
  • add deprecation warning to the old file
  • add a test that with calling the old class the deprecation warning is raised

Copy link
Member

@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.

need to maintain back compatibility... see #3251 (comment)

@mergify mergify bot requested a review from a team August 29, 2020 19:03
@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Aug 29, 2020

Also, should we consider the row_log_interval here, just like with usual logs?

probably, yes, in new PR?

ok, will add for both LearningRateMonitor and GPUStatsMonitor in a separate one.

@rohitgr7 rohitgr7 requested a review from Borda August 30, 2020 13:40
@rohitgr7
Copy link
Contributor Author

@Borda can you check if the depreciation is done correctly as you asked :) Thanks!

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.

LGTM

@mergify mergify bot requested a review from a team September 1, 2020 09:21
@Borda Borda added the refactor label Sep 1, 2020
pytorch_lightning/callbacks/lr_logger.py Outdated Show resolved Hide resolved
tests/callbacks/test_lr_monitor.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team September 1, 2020 09:51
@rohitgr7 rohitgr7 requested a review from Borda September 1, 2020 17:30
@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Sep 2, 2020

@Borda can you review this? Thanks

@Borda Borda added the ready PRs ready to be merged label Sep 3, 2020
@mergify
Copy link
Contributor

mergify bot commented Sep 3, 2020

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

@mergify mergify bot merged commit 4a22fca into master Sep 3, 2020
@mergify
Copy link
Contributor

mergify bot commented Sep 3, 2020

Great job! =)

@rohitgr7 rohitgr7 deleted the enhance/lr_logger_name branch September 3, 2020 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants