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

Addition of Random frequency mask transform #1680

Merged
merged 13 commits into from
Oct 9, 2024

Conversation

payo101
Copy link
Contributor

@payo101 payo101 commented Oct 7, 2024

Modified file(s)

  • lightly/transforms/__init__.py: Added new transform imports
  • lightly/transforms/random_crop_and_flip_with_grid.py: Resolved mypy issue for Any subclassing

Created file(s)

  • lightly/transforms/random_frequency_mask_transform.py
  • tests/transforms/test_random_frequency_mask_transform.py

Closes: #1660

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.78%. Comparing base (5d10e60) to head (84379f4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1680      +/-   ##
==========================================
+ Coverage   84.74%   84.78%   +0.03%     
==========================================
  Files         153      154       +1     
  Lines        6465     6480      +15     
==========================================
+ Hits         5479     5494      +15     
  Misses        986      986              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR! I left some comments, let me know what you think. The most important is to make k configurable.

lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
jizhang02 and others added 5 commits October 9, 2024 01:18
* Replace lambda functions with named functions in the examples
* Move public classes and functions to top in lightly/data

* Move public classes and functions to top in lightly/models/modules

* Move public classes and functions to top in lightly/utils

* Move public classes and functions to top in lightly/loss

* Reformat after black failure

---------

Co-authored-by: Saurav Maheshkar <[email protected]>
@payo101
Copy link
Contributor Author

payo101 commented Oct 9, 2024

@guarin @philippmwirth I have made the changes, could you guys review the PR now?

Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

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

Thanks for the update! There is only one thing left, the default for k should be (0.01, 0.1) as in the paper.

lightly/transforms/random_frequency_mask_transform.py Outdated Show resolved Hide resolved
@payo101
Copy link
Contributor Author

payo101 commented Oct 9, 2024

Done @guarin

Copy link
Contributor

@guarin guarin left a comment

Choose a reason for hiding this comment

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

LGTM! 🔥

@guarin guarin enabled auto-merge (squash) October 9, 2024 12:55
@guarin guarin merged commit 9da0a24 into lightly-ai:master Oct 9, 2024
12 checks passed
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.

9 participants