Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Default learning rate to None (default lr for the optimizer) #1172

Merged
merged 5 commits into from
Feb 15, 2022

Conversation

ethanwharris
Copy link
Collaborator

What does this PR do?

See discussion here: #1163 (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?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed 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

  • Is this pull request ready for review? (if not, please submit in draft mode)

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 🙃

@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #1172 (5c66179) into master (4c62482) will increase coverage by 0.01%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1172      +/-   ##
==========================================
+ Coverage   90.87%   90.89%   +0.01%     
==========================================
  Files         286      286              
  Lines       12758    12771      +13     
==========================================
+ Hits        11594    11608      +14     
+ Misses       1164     1163       -1     
Flag Coverage Δ
unittests 90.89% <92.85%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/audio/speech_recognition/model.py 100.00% <ø> (ø)
flash/graph/classification/model.py 91.66% <ø> (ø)
flash/image/classification/model.py 81.03% <ø> (ø)
flash/image/detection/model.py 96.42% <ø> (ø)
flash/image/embedding/model.py 88.46% <ø> (ø)
flash/image/instance_segmentation/model.py 90.90% <ø> (ø)
flash/image/keypoint_detection/model.py 90.47% <ø> (ø)
flash/image/segmentation/model.py 92.94% <ø> (ø)
flash/image/style_transfer/model.py 96.96% <ø> (ø)
flash/pointcloud/detection/model.py 80.39% <ø> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c62482...5c66179. Read the comment docs.

@justusschock
Copy link
Member

just a note: not all optimizers do have a default (e.g. SGD doesn't).

@ethanwharris
Copy link
Collaborator Author

@justusschock Yes good point, this PR has the side-effect of forcing users to provide an LR if they choose SGD. But I think that makes sense as this is consistent with the lack of a default in pytorch. It might be good to have an error message if the user chooses SGD and doesn't give a learning rate, I'll look into it 😃

@ethanwharris ethanwharris merged commit baf0b0d into master Feb 15, 2022
@ethanwharris ethanwharris deleted the feature/default_lr branch February 15, 2022 17:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants