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

turn ncm to dynamic module that adapts with 0 vectors at evaluation #1458

Merged
merged 1 commit into from Jul 14, 2023

Conversation

AlbinSou
Copy link
Collaborator

Adds an adaptation at evaluation for NCM so that it fills class_means_dict with torch.zeros (default behavior for non-pre-existing classes).

Previously using eval_every=1 would fail unless all classes are present in the class_means_dict. Now it still fails for the first step (no classes in dict) since the feature size is unknown when no feature vectors are present. But it does not fail anymore for other steps.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5553432679

  • 7 of 9 (77.78%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 72.843%

Changes Missing Coverage Covered Lines Changed/Added Lines %
avalanche/models/ncm_classifier.py 7 9 77.78%
Totals Coverage Status
Change from base Build 5478303948: 0.3%
Covered Lines: 16703
Relevant Lines: 22930

💛 - Coveralls

@AntonioCarta AntonioCarta merged commit 435b40d into ContinualAI:master Jul 14, 2023
18 checks passed
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.

None yet

3 participants