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

allow decorate model init with saving hparams #4662

Merged
merged 11 commits into from
Nov 16, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Nov 13, 2020

What does this PR do?

Allow decorating Model init and still be able to save hparams

Resolves #4525

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.
Before you start reviewing make sure you have read Review guidelines. In in short, see 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; Bugfixes should be including in bug-fix release milestones (m.f.X) and features should be included in (m.X.b) releases.

Did you have fun?

Make sure you had fun coding 🙃

@Borda Borda added bug Something isn't working feature Is an improvement or enhancement checkpointing Related to checkpointing labels Nov 13, 2020
@Borda Borda added this to the 1.1 milestone Nov 13, 2020
@pep8speaks
Copy link

pep8speaks commented Nov 13, 2020

Hello @Borda! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-11-16 02:24:59 UTC

@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #4662 (e182788) into master (886702a) will increase coverage by 3%.
The diff coverage is 95%.

@@           Coverage Diff           @@
##           master   #4662    +/-   ##
=======================================
+ Coverage      90%     93%    +3%     
=======================================
  Files         117     117            
  Lines        8922    8932    +10     
=======================================
+ Hits         8038    8296   +258     
+ Misses        884     636   -248     

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

Great addition ! Can you just test out several layer decorator ?

tests/models/test_hparams.py Show resolved Hide resolved
@Borda Borda force-pushed the feature/4525_decorated-hparams branch from 1ce4676 to f3b9c38 Compare November 13, 2020 22:12
@Borda Borda requested a review from tchaton November 13, 2020 22:14
Copy link
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.

Awesome PR !

@Borda Borda added the ready PRs ready to be merged label Nov 14, 2020
CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@SeanNaren SeanNaren left a comment

Choose a reason for hiding this comment

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

Curious on the use case, but LGTM!

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

@Borda Borda merged commit be60efb into master Nov 16, 2020
@Borda Borda deleted the feature/4525_decorated-hparams branch November 16, 2020 10:02
@tchaton tchaton modified the milestones: 1.1, 1.0.x Nov 17, 2020
tchaton added a commit that referenced this pull request Nov 17, 2020
* addd tests

* use boring model

* parsing init

* chlog

* double decorate

* Apply suggestions from code review

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* bug

Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
rohitgr7 pushed a commit that referenced this pull request Nov 21, 2020
* addd tests

* use boring model

* parsing init

* chlog

* double decorate

* Apply suggestions from code review

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* bug

Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working checkpointing Related to checkpointing feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

save_hyperparameters() doesn't work with decorated __init__()
7 participants