Repository navigation
MAPA: accept ch_mask with per-sample sensor_indices - #1550
Merged
Merged
Conversation
bruAristimunha
approved these changes
Nov 5, 2026
bruAristimunha
left a comment
Collaborator
There was a problem hiding this comment.
Seems fine for me, but can we plan where we can use the new functions too in another PR?
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Nov 9, 2026
Brings in the ch_mask series (braindecode#1545, braindecode#1548, braindecode#1540, braindecode#1542-braindecode#1544, braindecode#1549, braindecode#1550) and braindecode#1557/braindecode#1559. No conflicts.
bruAristimunha
added a commit
to bruAristimunha/braindecode
that referenced
this pull request
Nov 9, 2026
Brings in the ch_mask series (braindecode#1545 braindecode#1548 braindecode#1540 braindecode#1549 braindecode#1542 braindecode#1543 braindecode#1544 braindecode#1550), braindecode#1557 and braindecode#1559 (master dba9d42). No conflicts; NOTICE.txt and docs/whats_new.rst carry only this PR's additions over master.
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.
MAPAaccepts ach_maskof real channels with per-samplesensor_indices,(batch, n_chans, 3), so one batch can mix recordings with different montages and channel counts, as the iEEG foundation models of #1487.return_featuresalso returns"tokens",(batch, n_chans, n_tokens, dim), zero for padded channels, as iEEG foundation models: return the per-token output, padded channels zeroed #1540. The shared(n_chans, 3)path is unchanged;ch_maskneeds per-samplesensor_indicesandpooling="mean".Testing
test_ch_mask.py(_CASES: each recording matches running alone, eager and scripted, no gradient into padding, tokens zero) and to_CH_MASK_EXTRAS; strict xfail intest_registered_model_ch_mask_training(the loader routes nosensor_indices);pytest test/unit_tests/models/test_ch_mask.py test/unit_tests/models/test_model_contract.py test/unit_tests/training/test_ch_mask_training.py -k ch_mask: 67 passed, 3 xfailedpytest test/unit_tests/models -k "mapa or MAPA": 70 passedpre-commit run --files <changed files>: passed