-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fixed bug where tuner would not tune lr if also tuning batch_size #4688
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
Conversation
…ior for the smoothed loss as before the bug fix
|
Hello @Palzer! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-03-09 00:00:55 UTC |
Codecov Report
@@ Coverage Diff @@
## master #4688 +/- ##
=======================================
- Coverage 94% 92% -2%
=======================================
Files 161 161
Lines 11497 11497
=======================================
- Hits 10753 10529 -224
- Misses 744 968 +224 |
|
Not sure about the failing timing test. |
|
@Palzer the failing test seems to be unrelated to the change. Could you add some sort of test that shows the issue is solved? |
|
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. |
Borda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, mind add some test got this case? :]
tchaton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch ! Mind adding a test ?
|
My laptop died a week or so ago. New one should be arriving Monday and then I can take care of tests. Sorry for the delay! |
|
@Palzer there won't be any more releases in 1.1.x so I have changed your destination branch to feat 1.2 |
|
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/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Slack. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
self.beta**(current_step + 1) avoids division by 0
IMO we don't really need a test for this
) * fixed bug where tuner would not tune lr if also tuning batch_size * added a '+1' to computing the smoothed loss. This maintains the behavior for the smoothed loss as before the bug fix * pep8 fix * add changelog Co-authored-by: chaton <[email protected]> Co-authored-by: Carlos Mocholi <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> (cherry picked from commit 523c59b)
) * fixed bug where tuner would not tune lr if also tuning batch_size * added a '+1' to computing the smoothed loss. This maintains the behavior for the smoothed loss as before the bug fix * pep8 fix * add changelog Co-authored-by: chaton <[email protected]> Co-authored-by: Carlos Mocholi <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> (cherry picked from commit 523c59b)
What does this PR do?
current_step should be set to the global_step instead of global_step + 1. This fixes that issue which was causing the tuner to not tune the learning rate if also tuning batch_size. The comment on the line also implies that this change should have already been made.
Fixes #4616
Before submitting
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 in short, see following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃