Repository navigation
Let BaRISTA encode recordings with different montages - #1175
Merged
bruAristimunha merged 3 commits intoSep 21, 2026
Merged
bruAristimunha merged 3 commits into
bruAristimunha merged 3 commits into
Conversation
bruAristimunha
merged commit Sep 21, 2026
1f35ecc
into
braindecode:reopen-1171-barista
10 of 11 checks passed
Merged
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## reopen-1171-barista #1175 +/- ##
======================================================
Coverage ? 86.81%
======================================================
Files ? 143
Lines ? 16482
Branches ? 0
======================================================
Hits ? 14309
Misses ? 2173
Partials ? 0 🚀 New features to boost your workflow:
|
bruAristimunha
added a commit
that referenced
this pull request
Sep 29, 2026
* Restore BaRISTA model for review (#1171) * Simplify BaRISTA and fix model contract edge cases * Read BaRISTA spatial indices from dataset metadata * Preserve shared class targets with unique MNE event IDs * Link BaRISTA release note to the restored PR * changes to allow for different n_chans (#1175) Co-authored-by: Bru <[email protected]> * Simplify BaRISTA spatial setup and license note * Add BaRISTA figure and verify conversion of released weights * Publish the converted BaRISTA encoders to the Hub Make the converter the single recipe that ships with the weights: it now writes a model card and copies itself and NOTICE.txt into each Hub directory, and --push-to uploads them through BaRISTA.push_to_hub. The published encoders pool by mean so one file serves any montage and window length, and the class docstring points at the three repositories. * Publish BaRISTA encoders without the untrained head Co-authored-by: Cursor <[email protected]> * fix: validate BaRISTA forward indices and align the coordinate fallback - Move spatial indices passed to forward onto the embedding device and range-check them in eager mode (clear ValueError instead of IndexError; export/TorchScript/compile paths unchanged). - Reorder the MNE coordinate fallback to the (left, inferior, posterior) columns of the released tables; negated RAS alone gave (L, P, I). - Drop the converter's --pooling learned option, which saved a randomly initialised read-out: the releases carry no pooling weights. - Docstring opening follows the "<Name> from <Author> et al" convention. - Add test_barista.py: region scales, per-forward montages, invalid indices, the learned-pooling grid check and the coordinate order. * BaRISTA: keep the conversion script on the Hub, link the license The converter now lives only in the braindecode/BaRISTA-{coords,parcels,lobes} Hub repositories (synced with this PR's version); the docstring points there and the license note is a single link. * Keep BaRISTA notice concise with upstream license link * Integrate BaRISTA coverage into existing model tests --------- Co-authored-by: Julien GADONNEIX <[email protected]> Co-authored-by: Cursor <[email protected]>
Draft
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.
Follow-up to #1173. BaRISTA is currently locked to the montage and window length it was built with; this makes the montage a
forwardargument so a single model can encode recordings from different subjects.forward(x, spatial_indices=None, return_features=False):spatial_indicesis the montage of this batch,(n_chans, 3)for"coords"and(n_chans,)for the region scales. Omitting it falls back to the montage resolved at construction, somodel(X)behaves as before.chs_infopositions become the default montage instead of a requirement, and the "no spatial indices" error moves toforward.inv_freqbuffer instead of being baked into fixedcos/sinbuffers (numerically identical on the fixed grid).forwardare dropped:pooling="mean"accepts any montage and window length, whilepooling="learned"keeps its fixed token count and its error now points atpooling="mean".All BaRISTA tests pass, including the
torch.compile,torch.exportand TorchScript cases.