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

Refactor/feature layers id in fit #72

Merged
merged 8 commits into from
Sep 4, 2023

Conversation

paulnovello
Copy link
Member

@paulnovello paulnovello commented Aug 31, 2023

  • Replace the name of the method assign_ood_labels_by_class with split_by_class since it is more appropriate.
  • Put feature_layers_id argument in the method .fit. It seems more natural since .fit deals with the construction of the FeatureExtractor, and OODBaseDetector.__init__() with the parameters of the detector.
  • Add a property requires_internal_features to OODBaseDetector to maintain the behavior where usage of detectors acting on internal features without specifying internal features would throw a ValueError. It was otherwise difficult because after PR score() returns information with predictions and labels #70 feature_layers_id is no longer used by methods that act on logits only so we cannot throw an error solely based on the criterion that feature_layers_id is None

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1954 1786 91% 70% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
oodeel/init.py 100% 🟢
oodeel/datasets/ooddataset.py 91% 🟢
oodeel/methods/base.py 75% 🟢
oodeel/methods/dknn.py 100% 🟢
oodeel/methods/energy.py 100% 🟢
oodeel/methods/entropy.py 100% 🟢
oodeel/methods/mahalanobis.py 98% 🟢
oodeel/methods/mls.py 100% 🟢
oodeel/methods/odin.py 100% 🟢
oodeel/methods/vim.py 86% 🟢
TOTAL 95% 🟢

updated for commit: 06b5710 by action🐍

fix: fixed a test for torch FE

chore: flake8
Copy link
Contributor

@cofri cofri left a comment

Choose a reason for hiding this comment

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

I don't know if you've already requested reviews, but this is my last contribution for the next 3 weeks 🏖️
Nice feature! It rocks 🚀

oodeel/methods/base.py Show resolved Hide resolved
oodeel/methods/base.py Outdated Show resolved Hide resolved
oodeel/methods/base.py Outdated Show resolved Hide resolved
oodeel/methods/base.py Outdated Show resolved Hide resolved
oodeel/methods/base.py Outdated Show resolved Hide resolved
oodeel/methods/dknn.py Outdated Show resolved Hide resolved
Copy link
Member

@y-prudent y-prudent left a comment

Choose a reason for hiding this comment

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

Good job! 💪

README.md Outdated Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved
@paulnovello paulnovello merged commit fedba55 into master Sep 4, 2023
10 checks passed
@y-prudent y-prudent deleted the refactor/feature_layers_id_in_fit branch September 15, 2023 12:33
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.

output_layer_id should be required in the fit instead of instanciation of ood detector
3 participants