Braindecode 1.3.2.dev168583761__tar.gz → 1.3.2.dev169626090__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {braindecode-1.3.2.dev168583761/braindecode.egg-info → braindecode-1.3.2.dev169626090}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/hub.py +7 -17
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/hub_io.py +4 -19
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datautil/hub_formats.py +7 -13
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/__init__.py +0 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/base.py +17 -28
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/bendr.py +19 -69
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegsym.py +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sstdpn.py +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/summary.csv +0 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/util.py +11 -13
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/attention.py +1 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/mne_preprocess.py +1 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/preprocess.py +31 -61
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/util.py +4 -34
- braindecode-1.3.2.dev169626090/braindecode/version.py +1 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode.egg-info/SOURCES.txt +0 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/api.rst +9 -11
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/conf.py +6 -18
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/gnn.rst +1 -9
- braindecode-1.3.2.dev169626090/docs/models/categorization/spd.rst +35 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/models_categorization.rst +7 -6
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/whats_new.rst +5 -32
- braindecode-1.3.2.dev168583761/braindecode/models/dgcnn.py +0 -500
- braindecode-1.3.2.dev168583761/braindecode/version.py +0 -1
- braindecode-1.3.2.dev168583761/docs/models/categorization/spd.rst +0 -103
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/LICENSE.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/MANIFEST.in +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/NOTICE.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/README.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/classifier.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/brainmodule.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/config.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegpt.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/labram.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/luna.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/medformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/reve.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/tcn.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/regressor.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/Makefile +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/cite.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/help.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/index.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/install/install.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/models.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/pyproject.toml +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/setup.cfg +0 -0
{braindecode-1.3.2.dev168583761/braindecode.egg-info → braindecode-1.3.2.dev169626090}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.3.2.
|
|
3
|
+
Version: 1.3.2.dev169626090
|
|
4
4
|
Summary: Deep learning software to decode EEG, ECG or MEG signals
|
|
5
5
|
Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Alexandre Gramfort <agramfort@meta.com>
|
|
6
6
|
Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/datasets/bids/hub.py
RENAMED
|
@@ -103,7 +103,7 @@ class HubDatasetMixin:
|
|
|
103
103
|
compression: str = "blosc",
|
|
104
104
|
compression_level: int = 5,
|
|
105
105
|
pipeline_name: str = "braindecode",
|
|
106
|
-
chunk_size: int =
|
|
106
|
+
chunk_size: int = 10000,
|
|
107
107
|
local_cache_dir: str | Path | None = None,
|
|
108
108
|
**kwargs,
|
|
109
109
|
) -> str:
|
|
@@ -129,13 +129,10 @@ class HubDatasetMixin:
|
|
|
129
129
|
Compression level (0-9). Level 5 provides optimal balance.
|
|
130
130
|
pipeline_name : str, default="braindecode"
|
|
131
131
|
Name of the processing pipeline for BIDS sourcedata.
|
|
132
|
-
chunk_size : int, default=
|
|
133
|
-
Number of samples per chunk in Zarr
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
and pre-cut windows (WindowsDataset). For WindowsDataset, multiple
|
|
137
|
-
windows may be stored in a single chunk depending on their duration
|
|
138
|
-
and the chosen ``chunk_size``.
|
|
132
|
+
chunk_size : int, default=10000
|
|
133
|
+
Number of samples per chunk in Zarr. Larger chunk size will create fewer
|
|
134
|
+
but larger files. Only used for RawDataset and EEGWindowsDataset (continuous data).
|
|
135
|
+
With WindowsDataset (pre-cut epochs), each window is saved as a separate chunk.
|
|
139
136
|
local_cache_dir : str | Path | None
|
|
140
137
|
Local directory to use for temporary files during upload. If None, uses
|
|
141
138
|
the system temp directory and cleans it up after upload. If provided,
|
|
@@ -660,7 +657,7 @@ class HubDatasetMixin:
|
|
|
660
657
|
output_path: Path,
|
|
661
658
|
compression: str,
|
|
662
659
|
compression_level: int,
|
|
663
|
-
chunk_size: int =
|
|
660
|
+
chunk_size: int = 10000,
|
|
664
661
|
) -> None:
|
|
665
662
|
"""Convert dataset to Zarr format (inline implementation)."""
|
|
666
663
|
|
|
@@ -726,14 +723,7 @@ class HubDatasetMixin:
|
|
|
726
723
|
|
|
727
724
|
# Save using inlined function
|
|
728
725
|
_save_windows_to_zarr(
|
|
729
|
-
grp,
|
|
730
|
-
data,
|
|
731
|
-
metadata,
|
|
732
|
-
description,
|
|
733
|
-
info_dict,
|
|
734
|
-
compressor,
|
|
735
|
-
target_name,
|
|
736
|
-
chunk_size,
|
|
726
|
+
grp, data, metadata, description, info_dict, compressor, target_name
|
|
737
727
|
)
|
|
738
728
|
|
|
739
729
|
elif dataset_type == "EEGWindowsDataset":
|
|
@@ -45,25 +45,16 @@ def _restore_nan_from_json(obj):
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
def _save_windows_to_zarr(
|
|
48
|
-
grp, data, metadata, description, info, compressor, target_name
|
|
48
|
+
grp, data, metadata, description, info, compressor, target_name
|
|
49
49
|
):
|
|
50
50
|
"""Save windowed data to Zarr group (low-level function)."""
|
|
51
51
|
data_array = data.astype(np.float32)
|
|
52
52
|
compressors_list = [compressor] if compressor is not None else None
|
|
53
53
|
|
|
54
|
-
max_windows_per_chunk = max(
|
|
55
|
-
1, chunk_size // (data_array.shape[1] * data_array.shape[2])
|
|
56
|
-
)
|
|
57
|
-
n_windows_per_chunk = min(data_array.shape[0], max_windows_per_chunk)
|
|
58
|
-
|
|
59
54
|
grp.create_array(
|
|
60
55
|
"data",
|
|
61
56
|
data=data_array,
|
|
62
|
-
chunks=(
|
|
63
|
-
n_windows_per_chunk,
|
|
64
|
-
data_array.shape[1],
|
|
65
|
-
data_array.shape[2],
|
|
66
|
-
),
|
|
57
|
+
chunks=(1, data_array.shape[1], data_array.shape[2]),
|
|
67
58
|
compressors=compressors_list,
|
|
68
59
|
)
|
|
69
60
|
|
|
@@ -94,13 +85,10 @@ def _save_eegwindows_to_zarr(
|
|
|
94
85
|
continuous_float = continuous_data.astype(np.float32)
|
|
95
86
|
compressors_list = [compressor] if compressor is not None else None
|
|
96
87
|
|
|
97
|
-
max_samples_per_chunk = max(1, chunk_size // continuous_float.shape[0])
|
|
98
|
-
n_samples_per_chunk = min(continuous_float.shape[1], max_samples_per_chunk)
|
|
99
|
-
|
|
100
88
|
grp.create_array(
|
|
101
89
|
"data",
|
|
102
90
|
data=continuous_float,
|
|
103
|
-
chunks=(continuous_float.shape[0],
|
|
91
|
+
chunks=(continuous_float.shape[0], min(chunk_size, continuous_float.shape[1])),
|
|
104
92
|
compressors=compressors_list,
|
|
105
93
|
)
|
|
106
94
|
|
|
@@ -169,13 +157,10 @@ def _save_raw_to_zarr(grp, raw, description, info, target_name, compressor, chun
|
|
|
169
157
|
continuous_float = continuous_data.astype(np.float32)
|
|
170
158
|
compressors_list = [compressor] if compressor is not None else None
|
|
171
159
|
|
|
172
|
-
max_samples_per_chunk = max(1, chunk_size // continuous_float.shape[0])
|
|
173
|
-
n_samples_per_chunk = min(continuous_float.shape[1], max_samples_per_chunk)
|
|
174
|
-
|
|
175
160
|
grp.create_array(
|
|
176
161
|
"data",
|
|
177
162
|
data=continuous_float,
|
|
178
|
-
chunks=(continuous_float.shape[0],
|
|
163
|
+
chunks=(continuous_float.shape[0], min(chunk_size, continuous_float.shape[1])),
|
|
179
164
|
compressors=compressors_list,
|
|
180
165
|
)
|
|
181
166
|
|
|
@@ -36,7 +36,7 @@ def convert_to_zarr(
|
|
|
36
36
|
output_path: Union[str, Path],
|
|
37
37
|
compression: str = "blosc",
|
|
38
38
|
compression_level: int = 5,
|
|
39
|
-
chunk_size: int =
|
|
39
|
+
chunk_size: int = 10000,
|
|
40
40
|
overwrite: bool = False,
|
|
41
41
|
) -> Path:
|
|
42
42
|
"""Convert BaseConcatDataset to Zarr format.
|
|
@@ -59,13 +59,10 @@ def convert_to_zarr(
|
|
|
59
59
|
blosc uses zstd codec by default, providing best balance of speed and compression.
|
|
60
60
|
compression_level : int, default=5
|
|
61
61
|
Compression level (0-9). Level 5 provides optimal balance based on benchmarks.
|
|
62
|
-
chunk_size : int, default=
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
larger chunks on disk.
|
|
67
|
-
For pre-cut windowed data (WindowsDataset), this controls how many windows are
|
|
68
|
-
grouped together in each chunk (i.e., multiple windows can be stored per chunk).
|
|
62
|
+
chunk_size : int, default=10000
|
|
63
|
+
Number of samples per chunk in Zarr. Larger chunk size will create fewer
|
|
64
|
+
but larger files. Only used for RawDataset and EEGWindowsDataset (continuous data).
|
|
65
|
+
With WindowsDataset (pre-cut epochs), each window is saved as a separate chunk.
|
|
69
66
|
overwrite : bool, default=False
|
|
70
67
|
Whether to overwrite existing directory.
|
|
71
68
|
|
|
@@ -77,11 +74,8 @@ def convert_to_zarr(
|
|
|
77
74
|
Notes
|
|
78
75
|
-----
|
|
79
76
|
The chunking strategy is optimized for random access:
|
|
80
|
-
- Windowed data:
|
|
81
|
-
|
|
82
|
-
determined by ``chunk_size``.
|
|
83
|
-
- Raw / continuous data: Time is split into chunks of approximately
|
|
84
|
-
``chunk_size`` samples (per channel), e.g., (n_channels, n_times_per_chunk).
|
|
77
|
+
- Windowed data: Each window is a separate chunk (1, n_channels, n_times)
|
|
78
|
+
- Raw data: Chunks of (n_channels, 10000) samples
|
|
85
79
|
|
|
86
80
|
Examples
|
|
87
81
|
--------
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/__init__.py
RENAMED
|
@@ -12,7 +12,6 @@ from .contrawr import ContraWR
|
|
|
12
12
|
from .ctnet import CTNet
|
|
13
13
|
from .deep4 import Deep4Net
|
|
14
14
|
from .deepsleepnet import DeepSleepNet
|
|
15
|
-
from .dgcnn import DGCNN
|
|
16
15
|
from .eegconformer import EEGConformer
|
|
17
16
|
from .eeginception_erp import EEGInceptionERP
|
|
18
17
|
from .eeginception_mi import EEGInceptionMI
|
|
@@ -88,7 +87,6 @@ __all__ = [
|
|
|
88
87
|
"EEGSym",
|
|
89
88
|
"EEGSimpleConv",
|
|
90
89
|
"EEGTCNet",
|
|
91
|
-
"DGCNN",
|
|
92
90
|
"FBCNet",
|
|
93
91
|
"FBLightConvNet",
|
|
94
92
|
"FBMSNet",
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/base.py
RENAMED
|
@@ -86,44 +86,38 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=NumpyDocstringInheritanceInitMeta)
|
|
|
86
86
|
-----
|
|
87
87
|
If some input signal-related parameters are not specified,
|
|
88
88
|
there will be an attempt to infer them from the other parameters.
|
|
89
|
-
"""
|
|
90
89
|
|
|
91
|
-
#: Template for model-specific Hub integration notes appended by
|
|
92
|
-
#: ``__init_subclass__``. ``{name}`` is replaced with the concrete
|
|
93
|
-
#: model class name.
|
|
94
|
-
_HUB_NOTES_TEMPLATE = """
|
|
95
90
|
.. rubric:: Hugging Face Hub integration
|
|
96
91
|
|
|
97
92
|
When the optional ``huggingface_hub`` package is installed, all models
|
|
98
93
|
automatically gain the ability to be pushed to and loaded from the
|
|
99
94
|
Hugging Face Hub. Install with::
|
|
100
95
|
|
|
101
|
-
pip install braindecode[
|
|
96
|
+
pip install braindecode[hug]
|
|
102
97
|
|
|
103
98
|
**Pushing a model to the Hub:**
|
|
104
99
|
|
|
105
|
-
.. code-block::
|
|
100
|
+
.. code-block:: python
|
|
106
101
|
|
|
107
|
-
from braindecode.models import
|
|
102
|
+
from braindecode.models import EEGNetv4
|
|
108
103
|
|
|
109
104
|
# Train your model
|
|
110
|
-
model =
|
|
105
|
+
model = EEGNetv4(n_chans=22, n_outputs=4, n_times=1000)
|
|
111
106
|
# ... training code ...
|
|
112
107
|
|
|
113
108
|
# Push to the Hub
|
|
114
109
|
model.push_to_hub(
|
|
115
|
-
repo_id="username/my-
|
|
116
|
-
commit_message="Initial model upload",
|
|
110
|
+
repo_id="username/my-eegnet-model", commit_message="Initial model upload"
|
|
117
111
|
)
|
|
118
112
|
|
|
119
113
|
**Loading a model from the Hub:**
|
|
120
114
|
|
|
121
|
-
.. code-block::
|
|
115
|
+
.. code-block:: python
|
|
122
116
|
|
|
123
|
-
from braindecode.models import
|
|
117
|
+
from braindecode.models import EEGNetv4
|
|
124
118
|
|
|
125
119
|
# Load pretrained model
|
|
126
|
-
model =
|
|
120
|
+
model = EEGNetv4.from_pretrained("username/my-eegnet-model")
|
|
127
121
|
|
|
128
122
|
The integration automatically handles EEG-specific parameters (n_chans,
|
|
129
123
|
n_times, sfreq, chs_info, etc.) by saving them in a config file alongside
|
|
@@ -132,24 +126,19 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=NumpyDocstringInheritanceInitMeta)
|
|
|
132
126
|
|
|
133
127
|
.. important::
|
|
134
128
|
Currently, only EEG-specific parameters (n_outputs, n_chans, n_times,
|
|
135
|
-
input_window_seconds, sfreq, chs_info) are saved to the Hub.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
input_window_seconds, sfreq, chs_info) are saved to the Hub. Model-specific
|
|
130
|
+
parameters (e.g., dropout rates, activation functions, number of filters)
|
|
131
|
+
are not preserved and will use their default values when loading from the Hub.
|
|
132
|
+
|
|
133
|
+
To use non-default model parameters, specify them explicitly when calling
|
|
134
|
+
:func:`from_pretrained()`::
|
|
135
|
+
|
|
136
|
+
model = EEGNet.from_pretrained("user/model", dropout=0.3, activation='relu')
|
|
137
|
+
|
|
139
138
|
Full parameter serialization will be addressed in a future update.
|
|
140
139
|
"""
|
|
141
140
|
|
|
142
141
|
def __init_subclass__(cls, **kwargs):
|
|
143
|
-
# Append model-specific Hub integration notes to the docstring.
|
|
144
|
-
# This runs after the metaclass, so we concatenate rather than
|
|
145
|
-
# override any existing Notes section in the subclass.
|
|
146
|
-
if cls.__doc__ is not None:
|
|
147
|
-
hub_notes = cls._HUB_NOTES_TEMPLATE.format(
|
|
148
|
-
name=cls.__name__,
|
|
149
|
-
name_lower=cls.__name__.lower(),
|
|
150
|
-
)
|
|
151
|
-
cls.__doc__ = cls.__doc__.rstrip() + "\n" + hub_notes
|
|
152
|
-
|
|
153
142
|
if not HAS_HF_HUB:
|
|
154
143
|
super().__init_subclass__(**kwargs)
|
|
155
144
|
return
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/bendr.py
RENAMED
|
@@ -3,10 +3,8 @@ import copy
|
|
|
3
3
|
import torch
|
|
4
4
|
from einops.layers.torch import Rearrange
|
|
5
5
|
from torch import nn
|
|
6
|
-
from torch.nn.utils.parametrize import register_parametrization
|
|
7
6
|
|
|
8
7
|
from braindecode.models.base import EEGModuleMixin
|
|
9
|
-
from braindecode.modules.parametrization import MaxNormParametrize
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
class BENDR(EEGModuleMixin, nn.Module):
|
|
@@ -185,25 +183,6 @@ class BENDR(EEGModuleMixin, nn.Module):
|
|
|
185
183
|
final_layer : bool, default=True
|
|
186
184
|
If True, includes a final linear classification layer that maps from encoder_h to
|
|
187
185
|
n_outputs. If False, the model outputs the contextualized features directly.
|
|
188
|
-
encoder_only : bool, default=False
|
|
189
|
-
If True, bypass the contextualizer and use 4-chunk temporal pooling on the encoder
|
|
190
|
-
output instead. This corresponds to the encoder-only configuration described in
|
|
191
|
-
Section 2.4 and Table 2 of Kostas et al. (2021) [bendr]_, which outperformed the
|
|
192
|
-
full model on 4 out of 5 downstream tasks. The encoder output is split into 4 equal
|
|
193
|
-
temporal chunks, each chunk is mean-pooled, and the results are concatenated to
|
|
194
|
-
produce a feature vector of size ``encoder_h * 4`` (2048-dim with default settings).
|
|
195
|
-
The contextualizer is still created (to allow loading pretrained weights) but is not
|
|
196
|
-
used in the forward pass. Requires input length of at least
|
|
197
|
-
``4 * product(enc_downsample)`` samples (384 with default downsampling of 96x).
|
|
198
|
-
n_chans_pretrained : int or None, default=None
|
|
199
|
-
Number of input channels the pretrained weights expect (20 for the official BENDR
|
|
200
|
-
checkpoint). When set and ``n_chans != n_chans_pretrained``, a 1x1 Conv1d with
|
|
201
|
-
max-norm constraint projects from ``n_chans`` to ``n_chans_pretrained`` before the
|
|
202
|
-
encoder. This allows fine-tuning pretrained BENDR on datasets with arbitrary channel
|
|
203
|
-
counts. When using ``from_pretrained``, pass ``strict=False`` since the checkpoint
|
|
204
|
-
will not contain ``channel_projection`` weights.
|
|
205
|
-
chan_proj_max_norm : float, default=1.0
|
|
206
|
-
Max-norm constraint value for the channel projection weights.
|
|
207
186
|
"""
|
|
208
187
|
|
|
209
188
|
def __init__(
|
|
@@ -230,9 +209,6 @@ class BENDR(EEGModuleMixin, nn.Module):
|
|
|
230
209
|
enc_downsample=(3, 2, 2, 2, 2, 2),
|
|
231
210
|
start_token=-5, # Value for start token embedding
|
|
232
211
|
final_layer=True, # Whether to include the final linear layer
|
|
233
|
-
encoder_only=False, # If True, bypass contextualizer and use 4-chunk pooling
|
|
234
|
-
n_chans_pretrained=None, # Expected input channels of pretrained weights
|
|
235
|
-
chan_proj_max_norm=1.0, # Max-norm for channel projection weights
|
|
236
212
|
):
|
|
237
213
|
super().__init__(
|
|
238
214
|
n_outputs=n_outputs,
|
|
@@ -249,22 +225,10 @@ class BENDR(EEGModuleMixin, nn.Module):
|
|
|
249
225
|
self.encoder_h = encoder_h
|
|
250
226
|
self.contextualizer_hidden = contextualizer_hidden
|
|
251
227
|
self.include_final_layer = final_layer
|
|
252
|
-
self.encoder_only = encoder_only
|
|
253
|
-
|
|
254
|
-
# Channel projection for pretrained weight compatibility
|
|
255
|
-
encoder_n_chans = self.n_chans
|
|
256
|
-
if n_chans_pretrained is not None and self.n_chans != n_chans_pretrained:
|
|
257
|
-
conv = nn.Conv1d(self.n_chans, n_chans_pretrained, 1, bias=False)
|
|
258
|
-
register_parametrization(
|
|
259
|
-
conv, "weight", MaxNormParametrize(chan_proj_max_norm)
|
|
260
|
-
)
|
|
261
|
-
self.channel_projection = conv
|
|
262
|
-
encoder_n_chans = n_chans_pretrained
|
|
263
|
-
else:
|
|
264
|
-
self.channel_projection = None
|
|
265
228
|
|
|
229
|
+
# Encoder: Use parameters from __init__
|
|
266
230
|
self.encoder = _ConvEncoderBENDR(
|
|
267
|
-
in_features=
|
|
231
|
+
in_features=self.n_chans,
|
|
268
232
|
encoder_h=encoder_h,
|
|
269
233
|
dropout=drop_prob,
|
|
270
234
|
projection_head=projection_head,
|
|
@@ -284,49 +248,35 @@ class BENDR(EEGModuleMixin, nn.Module):
|
|
|
284
248
|
layer_drop=layer_drop,
|
|
285
249
|
start_token=start_token, # Keep fixed start token value
|
|
286
250
|
)
|
|
287
|
-
|
|
288
|
-
# full model → start token produces encoder_h features
|
|
289
|
-
if self.encoder_only:
|
|
290
|
-
in_features = encoder_h * 4
|
|
291
|
-
else:
|
|
292
|
-
in_features = encoder_h
|
|
251
|
+
in_features = self.encoder.encoder_h # Set in_features for final layer
|
|
293
252
|
|
|
294
253
|
self.final_layer = None
|
|
295
254
|
if self.include_final_layer:
|
|
296
|
-
#
|
|
255
|
+
# Input to Linear will be [batch_size, encoder_h] after taking last timestep
|
|
297
256
|
linear = nn.Linear(in_features=in_features, out_features=self.n_outputs)
|
|
298
257
|
self.final_layer = nn.utils.parametrizations.weight_norm(
|
|
299
258
|
linear, name="weight", dim=1
|
|
300
259
|
)
|
|
301
260
|
|
|
302
261
|
def forward(self, x):
|
|
303
|
-
|
|
304
|
-
x = self.channel_projection(x)
|
|
262
|
+
# Input x: [batch_size, n_chans, n_times]
|
|
305
263
|
encoded = self.encoder(x)
|
|
306
264
|
# encoded: [batch_size, encoder_h, n_encoded_times]
|
|
307
265
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
# context: [batch_size, encoder_h, n_encoded_times + 1] (due to start token)
|
|
323
|
-
|
|
324
|
-
# Extract features - use the output corresponding to the start token (index 0)
|
|
325
|
-
# According to the paper (Kostas et al. 2021): "The transformer output of this
|
|
326
|
-
# initial position was not modified during pre-training, and only used for
|
|
327
|
-
# downstream tasks." This follows BERT's [CLS] token convention.
|
|
328
|
-
feature = context[:, :, 0]
|
|
329
|
-
# feature: [batch_size, encoder_h]
|
|
266
|
+
context = self.contextualizer(encoded)
|
|
267
|
+
# context: [batch_size, encoder_h, n_encoded_times + 1] (due to start token)
|
|
268
|
+
|
|
269
|
+
# Extract features - use the output corresponding to the start token (index 0)
|
|
270
|
+
# The output has shape [batch_size, features, seq_len+1]
|
|
271
|
+
# The start token was prepended at position 0 in the contextualizer before the
|
|
272
|
+
# transformer layers. After permutation back to [batch, features, seq_len+1],
|
|
273
|
+
# the start token output is at index 0.
|
|
274
|
+
# According to the paper (Kostas et al. 2021): "The transformer output of this
|
|
275
|
+
# initial position was not modified during pre-training, and only used for
|
|
276
|
+
# downstream tasks." This follows BERT's [CLS] token convention where the
|
|
277
|
+
# first token aggregates sequence information via self-attention.
|
|
278
|
+
feature = context[:, :, 0]
|
|
279
|
+
# feature: [batch_size, encoder_h]
|
|
330
280
|
|
|
331
281
|
if self.final_layer is not None:
|
|
332
282
|
feature = self.final_layer(feature)
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/eegsym.py
RENAMED
|
@@ -112,7 +112,7 @@ class EEGSym(EEGModuleMixin, nn.Module):
|
|
|
112
112
|
corresponding to different frequency characteristics.
|
|
113
113
|
|
|
114
114
|
Notes
|
|
115
|
-
|
|
115
|
+
----------
|
|
116
116
|
* EEGSym achieved competitive accuracies across five large MI datasets [eegsym2022]_.
|
|
117
117
|
* The model maintained high accuracy using a reduced set of electrodes (8 or 16 channels)
|
|
118
118
|
[eegsym2022]_.
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/sstdpn.py
RENAMED
|
@@ -133,7 +133,7 @@ class SSTDPN(EEGModuleMixin, nn.Module):
|
|
|
133
133
|
learning data, according to [Han2025]_.
|
|
134
134
|
|
|
135
135
|
Notes
|
|
136
|
-
|
|
136
|
+
----------
|
|
137
137
|
* The implementation of the DPL loss functions (:math:`\mathcal{L}_S`, :math:`\mathcal{L}_C`, :math:`\mathcal{L}_{EF}`)
|
|
138
138
|
and the optimization of ICPs are typically handled outside the primary ``forward`` method, within the training strategy
|
|
139
139
|
(see Ref. 52 in [Han2025]_).
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/summary.csv
RENAMED
|
@@ -47,4 +47,3 @@ BENDR,General,"Classification,Embedding",250,"n_chans, n_times, n_outputs",15714
|
|
|
47
47
|
LUNA,General,"Classification,Embedding",128,"n_chans, n_times, sfreq, chs_info",7100731,"LUNA(n_chans=22, n_times=512, sfreq=128)","Convolution,Channel,Foundation Model"
|
|
48
48
|
MEDFormer,General,Classification,250,"n_chans, n_outputs, n_times",5313924,"MEDFormer(n_chans=22, n_outputs=4, n_times=1000)","Foundation Model,Convolution"
|
|
49
49
|
REVE,General,Classification,200,"n_outputs, n_times, n_chans",69481476,"REVE(n_times=1000, n_outputs=4, n_chans=19)","Foundation Model,Attention/Transformer"
|
|
50
|
-
DGCNN,Emotion Recognition,Classification,128,"n_chans, n_outputs, n_times, chs_info",1037385,"DGCNN(n_chans=62, n_outputs=4, n_times=128)","Graph Neural Network,Channel"
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/models/util.py
RENAMED
|
@@ -133,7 +133,6 @@ models_mandatory_parameters: list[
|
|
|
133
133
|
},
|
|
134
134
|
),
|
|
135
135
|
("CBraMod", ["n_outputs"], None),
|
|
136
|
-
("DGCNN", ["n_chans", "n_outputs", "n_times", "chs_info"], None),
|
|
137
136
|
]
|
|
138
137
|
|
|
139
138
|
################################################################
|
|
@@ -302,7 +301,7 @@ def extract_channel_locations_from_chs_info(
|
|
|
302
301
|
----------
|
|
303
302
|
chs_info : list of dict or None
|
|
304
303
|
Channel information, typically from ``mne.Info.chs``. Each dict should
|
|
305
|
-
contain a 'loc' key with a 12-element array (MNE format) where indices
|
|
304
|
+
contain a 'loc' key with a 12-element array (MNE format) where indices 3:6
|
|
306
305
|
represent the 3D cartesian coordinates.
|
|
307
306
|
num_channels : int or None
|
|
308
307
|
If specified, only extract the first ``num_channels`` channel locations.
|
|
@@ -316,7 +315,7 @@ def extract_channel_locations_from_chs_info(
|
|
|
316
315
|
|
|
317
316
|
Notes
|
|
318
317
|
-----
|
|
319
|
-
- This function handles both 12-element MNE location format (using indices
|
|
318
|
+
- This function handles both 12-element MNE location format (using indices 3:6)
|
|
320
319
|
and 3-element location format (using directly).
|
|
321
320
|
- Invalid or missing locations cause extraction to stop at that point.
|
|
322
321
|
- Returns None if no valid locations can be extracted.
|
|
@@ -348,9 +347,14 @@ def extract_channel_locations_from_chs_info(
|
|
|
348
347
|
try:
|
|
349
348
|
loc_array = np.asarray(loc, dtype=np.float32)
|
|
350
349
|
|
|
351
|
-
# MNE format: 12-element array with
|
|
352
|
-
if loc_array.ndim == 1 and loc_array.size >=
|
|
353
|
-
|
|
350
|
+
# MNE format: 12-element array with coordinates at indices 3:6
|
|
351
|
+
if loc_array.ndim == 1 and loc_array.size >= 6:
|
|
352
|
+
if loc_array.size == 12:
|
|
353
|
+
# Standard MNE format
|
|
354
|
+
coordinates = loc_array[3:6]
|
|
355
|
+
else:
|
|
356
|
+
# Assume first 3 elements are coordinates
|
|
357
|
+
coordinates = loc_array[:3]
|
|
354
358
|
else:
|
|
355
359
|
break
|
|
356
360
|
|
|
@@ -361,13 +365,7 @@ def extract_channel_locations_from_chs_info(
|
|
|
361
365
|
if len(locations) == 0:
|
|
362
366
|
return None
|
|
363
367
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
# Check positions are not all zero / degenerate
|
|
367
|
-
if np.allclose(result, 0):
|
|
368
|
-
return None
|
|
369
|
-
|
|
370
|
-
return result
|
|
368
|
+
return np.stack(locations, axis=0)
|
|
371
369
|
|
|
372
370
|
|
|
373
371
|
_summary_table = get_summary_table()
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev169626090}/braindecode/modules/attention.py
RENAMED
|
@@ -8,7 +8,6 @@ AttentionBaseNet class.
|
|
|
8
8
|
|
|
9
9
|
# Authors: Martin Wimpff <martin.wimpff@iss.uni-stuttgart.de>
|
|
10
10
|
# Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
11
|
-
# Sarthak Tayal <sarthaktayal2@gmail.com>
|
|
12
11
|
#
|
|
13
12
|
# License: BSD (3-clause)
|
|
14
13
|
|
|
@@ -61,7 +60,7 @@ class SqueezeAndExcitation(nn.Module):
|
|
|
61
60
|
)
|
|
62
61
|
self.nonlinearity = nn.ReLU()
|
|
63
62
|
self.fc2 = nn.Conv2d(
|
|
64
|
-
in_channels=
|
|
63
|
+
in_channels=reduction_rate,
|
|
65
64
|
out_channels=in_channels,
|
|
66
65
|
kernel_size=1,
|
|
67
66
|
bias=bias,
|
|
@@ -11,7 +11,6 @@ import mne.io
|
|
|
11
11
|
import mne.preprocessing
|
|
12
12
|
|
|
13
13
|
from braindecode.preprocessing.preprocess import Preprocessor
|
|
14
|
-
from braindecode.util import _clean_docstring_sections
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
def _is_standalone_function(func):
|
|
@@ -150,7 +149,7 @@ def _generate_mne_pre_processor(function):
|
|
|
150
149
|
force_copy_false = is_standalone and has_copy_param
|
|
151
150
|
class_attrs = {
|
|
152
151
|
"__init__": _generate_init_method(function, force_copy_false),
|
|
153
|
-
"__doc__": wrapper_note +
|
|
152
|
+
"__doc__": wrapper_note + (function.__doc__ or ""),
|
|
154
153
|
"__repr__": _generate_repr_method(class_name),
|
|
155
154
|
"fn": function if is_standalone else function.__name__,
|
|
156
155
|
"_is_standalone": is_standalone,
|