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

Revision of BYOL module and tests #874

Merged
merged 24 commits into from Sep 28, 2022

Conversation

matsumotosan
Copy link
Contributor

@matsumotosan matsumotosan commented Aug 25, 2022

What does this PR do?

Fixes part of #839

  • pl_bolts.models.self_supervised.byol.byol_module.BYOL
  • pl_bolts.models.self_supervised.byol.models.MLP
  • pl_bolts.models.self_supervised.byol.models.SiameseArm
  • pl_bolts.tests.models.self_supervised.test_models.test_byol

I cannot fix the CLI script as I do not have a GPU
pl_bolts.tests.models.self_supervised.test_models.test_ssl_scripts.test_cli_run_ssl_byol

Summary

  • Add method in BYOL to calculate loss for given online and target views
  • Add initial value of tau as an argument for BYOL
  • Remove predictor network from SiameseArm since it was not being used for target network and move to BYOL
  • Modify test_byol to use SimCLR transforms instead of CPC transforms
  • Fix CLI run test case

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 🙃

@github-actions github-actions bot added the model label Aug 25, 2022
@otaj otaj mentioned this pull request Aug 26, 2022
@matsumotosan matsumotosan marked this pull request as ready for review August 30, 2022 14:19
Copy link
Contributor

@otaj otaj left a comment

Choose a reason for hiding this comment

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

Hi, @matsumotosan! Thank you for this PR. I have to say, I love what you've done with byol_module in general, the meat of this module is now much more readable.

However, I left couple comments, which are mostly related to passing arguments around (similar to my comments in #873)

pl_bolts/models/self_supervised/byol/byol_module.py Outdated Show resolved Hide resolved
tests/models/self_supervised/test_models.py Outdated Show resolved Hide resolved
pl_bolts/models/self_supervised/byol/byol_module.py Outdated Show resolved Hide resolved
pl_bolts/models/self_supervised/byol/byol_module.py Outdated Show resolved Hide resolved
pl_bolts/models/self_supervised/byol/byol_module.py Outdated Show resolved Hide resolved
pl_bolts/models/self_supervised/byol/byol_module.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready label Sep 28, 2022
@otaj otaj merged commit d8ff64f into Lightning-Universe:master Sep 28, 2022
@matsumotosan matsumotosan deleted the byol_module branch September 28, 2022 10:16
@matsumotosan matsumotosan restored the byol_module branch October 8, 2022 21:10
@matsumotosan
Copy link
Contributor Author

@otaj I realized that the BYOL module is initialized with data_dir=datadir in test_byol. Should I re-open this PR to fix it or create a new PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants