Repository navigation
FIX EpiNT: z-score the whole window before dropping the samples after the last patch - #1488
Merged
Merged
Conversation
… the last patch As in the reference implementation, the instance norm runs on the full input and the remainder past n_patches * patch_size is dropped afterwards. Outputs are unchanged when n_times is a multiple of patch_size (the released 3072-sample checkpoint).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1488 +/- ##
==========================================
+ Coverage 91.08% 91.09% +0.01%
==========================================
Files 167 167
Lines 21677 21706 +29
==========================================
+ Hits 19744 19773 +29
Misses 1933 1933 🚀 New features to boost your workflow:
|
# Conflicts: # docs/whats_new.rst
2 tasks done
# Conflicts: # docs/whats_new.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The reference EpiNT runs
InstanceNorm1don the whole input, andunfoldthen drops the samples after the last full patch. The port cropped first, so those samples were left out of the normalization statistics. The output differed whenevern_timesis not a multiple ofpatch_size: 24 to 33 % relative difference on the class tokens at 3200 to 3327 samples with the released weights. With the released 3072-sample setting the output is unchanged.Changes
EpiNT.forwardnormalizes, then crops. The docstring is updated.test_epint_normalizes_the_whole_window: shifting the dropped samples changes the output. It does not on master.Testing
pytest test/unit_tests/models -k "epint or EpiNT": 47 passed, 2 skipped (pydantic not installed; compile runs on master only)pre-commit run --files <changed files>: passeddocs/whats_new.rstupdatedNotes for reviewers
Conflicts with #1487, which rewrites the same lines. Whichever lands second must keep the norm before the crop.