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

Update AE and VAE documentation #557

Merged
merged 3 commits into from
Mar 6, 2021

Conversation

jeremyadamsfisher
Copy link
Contributor

What does this PR do?

Previously, pretrained models were initialized with a static method. Now, they are initialized with an instance method. Upate docstring accordingly.

Fixes #543

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?

On the master and on this branch, I have the following test failures:

FAILED tests/models/test_scripts.py::test_cli_run_cpc[ --data_dir /home/j/Documents/pytorch-lightning-bolts/datasets --max_epochs 1 --limit_train_batches 2 --limit_val_batches 2 --batch_size 2 --encoder resnet18]
FAILED tests/models/self_supervised/test_models.py::test_byol - ValueError: not enough values to unpack (expected 3, got 2)
FAILED tests/models/self_supervised/test_scripts.py::test_cli_run_self_supervised_cpc[ --data_dir /home/j/Documents/pytorch-lightning-bolts/datasets --max_epochs 1 --max_steps 3 --fast_dev_run 1 --batch_size 2 --encoder resnet18 --num_workers 0]

They seem unrelated to this issue

  • 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?

🚀🚀🚀

Previously, pretrained models were initialized with a static method.
Now, they are initialized with an instance method. Upates docstring
accordingly.
@codecov
Copy link

codecov bot commented Feb 6, 2021

Codecov Report

Merging #557 (0c5981e) into master (86e3f52) will decrease coverage by 51.35%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #557       +/-   ##
===========================================
- Coverage   77.58%   26.23%   -51.36%     
===========================================
  Files         115      115               
  Lines        6701     6675       -26     
===========================================
- Hits         5199     1751     -3448     
- Misses       1502     4924     +3422     
Flag Coverage Δ
cpu 26.23% <ø> (ø)
pytest 26.23% <ø> (ø)
unittests ?

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

Impacted Files Coverage Δ
...ts/models/autoencoders/basic_ae/basic_ae_module.py 26.66% <ø> (-61.50%) ⬇️
.../models/autoencoders/basic_vae/basic_vae_module.py 22.91% <ø> (-68.84%) ⬇️
pl_bolts/models/rl/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
pl_bolts/models/rl/common/agents.py 0.00% <0.00%> (-100.00%) ⬇️
pl_bolts/models/rl/dueling_dqn_model.py 0.00% <0.00%> (-100.00%) ⬇️
pl_bolts/models/rl/double_dqn_model.py 0.00% <0.00%> (-95.66%) ⬇️
...l_bolts/models/rl/vanilla_policy_gradient_model.py 0.00% <0.00%> (-95.50%) ⬇️
pl_bolts/models/rl/common/networks.py 0.00% <0.00%> (-89.25%) ⬇️
pl_bolts/models/rl/reinforce_model.py 0.00% <0.00%> (-88.62%) ⬇️
pl_bolts/models/rl/per_dqn_model.py 0.00% <0.00%> (-86.67%) ⬇️
... and 65 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 86e3f52...2400a7c. Read the comment docs.

Copy link
Contributor

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

@jeremyadamsfisher Thank you for your contribution! LGTM!

@akihironitta akihironitta self-requested a review February 13, 2021 02:30
@akihironitta akihironitta added the documentation Improvements or additions to documentation label Feb 13, 2021
@akihironitta akihironitta self-assigned this Feb 13, 2021
@jeremyadamsfisher jeremyadamsfisher changed the title Update VAE documentation Update AE and VAE documentation Feb 13, 2021
@jeremyadamsfisher
Copy link
Contributor Author

@jeremyadamsfisher Would you mind fixing other places, too?

https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/c5b3c04c97239019e2a782189917276a43587be8/pl_bolts/models/autoencoders/basic_ae/basic_ae_module.py#L30

Done.

Other parts of the code don't have this issue because they don't have the API suggested in issue #200 . Here's where I've looked

  • SimCLR (SimCLR.load_from_checkpoint(weight_path, strict=False))
  • CPCV2 (CPCV2.load_from_checkpoint(weight_path, strict=False) or CPCV2(pretrained=True))
  • SwAV (SwAV.load_from_checkpoint(weight_path, strict=True))

Copy link
Contributor

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

@jeremyadamsfisher Thank you for your swift action!

@akihironitta akihironitta enabled auto-merge (squash) February 14, 2021 04:13
@akihironitta akihironitta mentioned this pull request Mar 4, 2021
8 tasks
@Borda Borda disabled auto-merge March 6, 2021 20:59
@Borda Borda merged commit 261a098 into Lightning-Universe:master Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation model ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slightly incorrect documentation for VAE
3 participants