Repository navigation
Add BaRISTA model - #1171
Add BaRISTA model#1171
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1171 +/- ##
==========================================
+ Coverage 86.57% 86.58% +0.01%
==========================================
Files 142 143 +1
Lines 16303 16563 +260
==========================================
+ Hits 14114 14341 +227
- Misses 2189 2222 +33 🚀 New features to boost your workflow:
|
BaRISTA pretrained weight loadingIt corresponds. The released checkpoint is a flat state dict of the pretraining model, and nothing but module naming separates it from the braindecode port: after renaming, every ported tensor matches a model tensor by name and shape, with zero left over. Coverage is 839,144 of 839,286 parameters — 100.0% to one decimal. What gets renamed
What is new
What is not used12 tensors, one per transformer layer: backbone.layers.N.attention.rotary_emb.inv_freq. These are rotary position frequencies, which the port recomputes from the layer geometry rather than storing, so dropping them loses nothing. |
|
Not related to the issue with docs! Seems very good for me! many thanks @julien-gadonneix 🙏🏽 |
|
My bad, I got confused with another model, I will open again the PR, and I will finish this one for you. |
* 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]>

Architecture verified against original codebase and paper.
Tests to load pretrained weights and reproduce results on the way.