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

lionel-lig-5887 remove heuristics in masked pooling #1777

Merged

Conversation

liopeer
Copy link
Contributor

@liopeer liopeer commented Jan 10, 2025

Changes

  • removes automatic detection of num_cls and makes this argument non-optionable
  • removes the test for automatic inference of num_cls
  • fixes an issue with the argument reduce, which was not actually propagated
  • brush up the docstring while at it

Necessity

  • using the heuristics was bad practice and could lead to issue when calling the function several times with different masks (e.g. different tensor output shapes from the two calls)
  • user of function should be aware of the classes in the dataset anyway

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.24%. Comparing base (f6ad8c7) to head (62875c4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1777      +/-   ##
==========================================
- Coverage   85.25%   85.24%   -0.01%     
==========================================
  Files         163      163              
  Lines        6834     6832       -2     
==========================================
- Hits         5826     5824       -2     
  Misses       1008     1008              

☔ 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.

LGTM!

lightly/models/utils.py Outdated Show resolved Hide resolved
@liopeer liopeer enabled auto-merge (squash) January 10, 2025 10:25
@liopeer liopeer merged commit c25309c into master Jan 10, 2025
12 checks passed
@liopeer liopeer deleted the lionel-lig-5887-make-arguments-to-masked-pooling-non-optional branch January 10, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants