Repository navigation
MAPA: load the braindecode-hosted weights, drop the fc1/fc2 key mapping - #1248
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1248 +/- ##
==========================================
- Coverage 88.62% 88.62% -0.01%
==========================================
Files 159 159
Lines 19547 19546 -1
==========================================
- Hits 17324 17323 -1
Misses 2223 2223 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The parity test must pin the documented checkpoint revision rather than track a mutable Hub branch.
1 open finding
What changed in this PR
Updates MAPA to load re-hosted pretrained weights through the standard Hub API and removes obsolete checkpoint key translation.
Changes:
- Removes MAPA’s legacy
fc1/fc2key mapping. - Documents the new pretrained repository and usage.
- Updates reference-feature testing to load the re-hosted checkpoint strictly.
| File | Description |
|---|---|
braindecode/models/mapa.py |
Documents Hub loading and removes legacy mapping. |
test/unit_tests/models/test_foundation_models.py |
Loads and validates the re-hosted checkpoint. |
docs/whats_new.rst |
Records the pretrained-loading change. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cache_dir=str(Path(mne_data_dir) / "mapa_pretrained"), | ||
| ) | ||
| model = MAPA.from_pretrained( | ||
| "braindecode/mapa-pretrained", |
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Oct 8, 2026
…nto fix/model-dtypes
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.

What changed
mapa_vits384with the standardfrom_pretrained:braindecode/mapa-pretrained(rev 56c68f7d), converted once from bentang18/MAPA@988efbf3mapa_vits384.pt(sha256 2d236089…, Apache-2.0). Files:config.json,model.safetensors,pytorch_model.bin,README.md,convert_mapa_checkpoint.pyand the authors'NOTICE.no_region,no_relpos,no_priors) are not re-hosted: no docstring or test loads them.MAPA.mapping(48 entries,mlp.fc1/fc2→mlp.0/mlp.3). The native file already uses theFeedForwardBlocknames, as Julien Gadonneix suggested in his 2026-10-02 comment on Add iEEG MAPA model #1178... important::box with the repo id and an example replaces the paragraph about loading the original file.test_mapa_released_checkpoint_reproduces_the_reference_featuresnow loads the new repo withstrict=Trueand checks the same values from the authors' code.Parity (2,420 entries)
mapa_vits384.ptthroughmapping.from_pretrained, on the staged directory and on the Hub repo in a fresh cache.Tests
-k mapa --run-networkintest_foundation_models.py: 24 passed.test/unit_tests/models -k "mapa and not compiled": 47 passed, 4 skipped.Diff: 3 files, +32 / −57.