Braindecode 1.3.2.dev168583761__tar.gz → 1.3.2.dev170355810__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.dev170355810}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/__init__.py +0 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/base.py +17 -28
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/bendr.py +19 -69
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegsym.py +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sstdpn.py +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/summary.csv +0 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/util.py +11 -13
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/attention.py +1 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/mne_preprocess.py +1 -2
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/preprocess.py +31 -61
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/util.py +4 -34
- braindecode-1.3.2.dev170355810/braindecode/version.py +1 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode.egg-info/SOURCES.txt +0 -1
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/api.rst +9 -11
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/conf.py +6 -18
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/gnn.rst +1 -9
- braindecode-1.3.2.dev170355810/docs/models/categorization/spd.rst +35 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/models_categorization.rst +7 -6
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/whats_new.rst +4 -31
- 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.dev170355810}/LICENSE.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/MANIFEST.in +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/NOTICE.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/README.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/classifier.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/hub.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/hub_io.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datautil/hub_formats.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/brainmodule.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/config.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegpt.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/labram.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/luna.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/medformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/reve.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/tcn.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/regressor.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/Makefile +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/cite.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/help.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/index.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/install/install.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/models.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/pyproject.toml +0 -0
- {braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810}/setup.cfg +0 -0
{braindecode-1.3.2.dev168583761/braindecode.egg-info → braindecode-1.3.2.dev170355810}/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.dev170355810
|
|
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.dev170355810}/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.dev170355810}/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.dev170355810}/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.dev170355810}/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.dev170355810}/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.dev170355810}/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.dev170355810}/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.dev170355810}/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,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
# Simon Brandt <simonbrandt@protonmail.com>
|
|
6
6
|
# David Sabbagh <dav.sabbagh@gmail.com>
|
|
7
7
|
# Bruno Aristimunha <b.aristimunha@gmail.com>
|
|
8
|
-
# Léo Burgund <leo.burgund@gmail.com>
|
|
9
8
|
#
|
|
10
9
|
# License: BSD (3-clause)
|
|
11
10
|
|
|
@@ -25,11 +24,11 @@ else:
|
|
|
25
24
|
from collections.abc import Callable
|
|
26
25
|
|
|
27
26
|
import numpy as np
|
|
27
|
+
import pandas as pd
|
|
28
28
|
from joblib import Parallel, delayed
|
|
29
29
|
from mne import BaseEpochs, create_info
|
|
30
30
|
from mne.io import BaseRaw
|
|
31
31
|
from numpy.typing import NDArray
|
|
32
|
-
from scipy.signal import lfilter
|
|
33
32
|
|
|
34
33
|
from braindecode.datasets.base import (
|
|
35
34
|
BaseConcatDataset,
|
|
@@ -425,17 +424,14 @@ def exponential_moving_standardize(
|
|
|
425
424
|
):
|
|
426
425
|
r"""Perform exponential moving standardization.
|
|
427
426
|
|
|
428
|
-
Compute the
|
|
429
|
-
|
|
430
|
-
:math:`m_t = \frac{\sum_{i=0}^t (1-\alpha)^i x_{t-i}}{\sum_{i=0}^t (1-\alpha)^i}`
|
|
431
|
-
where :math:`\alpha` is ``factor_new``.
|
|
427
|
+
Compute the exponental moving mean :math:`m_t` at time `t` as
|
|
428
|
+
:math:`m_t=\mathrm{factornew} \cdot mean(x_t) + (1 - \mathrm{factornew}) \cdot m_{t-1}`.
|
|
432
429
|
|
|
433
430
|
Then, compute exponential moving variance :math:`v_t` at time `t` as
|
|
434
|
-
|
|
435
|
-
:math:`v_t = \frac{\sum_{i=0}^t (1-\alpha)^i (x_{t-i} - m_{t-i})^2}{\sum_{i=0}^t (1-\alpha)^i}`.
|
|
431
|
+
:math:`v_t=\mathrm{factornew} \cdot (m_t - x_t)^2 + (1 - \mathrm{factornew}) \cdot v_{t-1}`.
|
|
436
432
|
|
|
437
433
|
Finally, standardize the data point :math:`x_t` at time `t` as:
|
|
438
|
-
:math:`x'_t=(x_t - m_t) / max(\sqrt{v_t}, eps)`.
|
|
434
|
+
:math:`x'_t=(x_t - m_t) / max(\sqrt{->v_t}, eps)`.
|
|
439
435
|
|
|
440
436
|
|
|
441
437
|
Parameters
|
|
@@ -452,52 +448,34 @@ def exponential_moving_standardize(
|
|
|
452
448
|
standardized: np.ndarray (n_channels, n_times)
|
|
453
449
|
Standardized data.
|
|
454
450
|
"""
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
# y_t = N_t / D_t
|
|
460
|
-
# N_t = x_t + (1-alpha) * N_{t-1}, N_0 = x_0
|
|
461
|
-
# D_t = 1 + (1-alpha) * D_{t-1}, D_0 = 1
|
|
462
|
-
alpha = factor_new
|
|
463
|
-
_, n_times = data.shape
|
|
464
|
-
inv_alpha = 1.0 - alpha
|
|
465
|
-
|
|
466
|
-
# Filter a sequence of ones: [1, 1+(1-a), 1+(1-a)+(1-a)^2, ...]
|
|
467
|
-
d = lfilter([1.0], [1.0, -inv_alpha], np.ones(n_times))
|
|
468
|
-
|
|
469
|
-
n = lfilter([1.0], [1.0, -inv_alpha], data, axis=1)
|
|
470
|
-
meaned = n / d
|
|
471
|
-
demeaned = data - meaned
|
|
472
|
-
|
|
451
|
+
data = data.T
|
|
452
|
+
df = pd.DataFrame(data)
|
|
453
|
+
meaned = df.ewm(alpha=factor_new).mean()
|
|
454
|
+
demeaned = df - meaned
|
|
473
455
|
squared = demeaned * demeaned
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
standardized = demeaned / np.maximum(eps, np.sqrt(square_ewmed))
|
|
478
|
-
|
|
456
|
+
square_ewmed = squared.ewm(alpha=factor_new).mean()
|
|
457
|
+
standardized = demeaned / np.maximum(eps, np.sqrt(np.array(square_ewmed)))
|
|
458
|
+
standardized = np.array(standardized)
|
|
479
459
|
if init_block_size is not None:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
460
|
+
i_time_axis = 0
|
|
461
|
+
init_mean = np.mean(data[0:init_block_size], axis=i_time_axis, keepdims=True)
|
|
462
|
+
init_std = np.std(data[0:init_block_size], axis=i_time_axis, keepdims=True)
|
|
463
|
+
init_block_standardized = (data[0:init_block_size] - init_mean) / np.maximum(
|
|
483
464
|
eps, init_std
|
|
484
465
|
)
|
|
485
|
-
standardized[
|
|
486
|
-
|
|
487
|
-
return standardized
|
|
466
|
+
standardized[0:init_block_size] = init_block_standardized
|
|
467
|
+
return standardized.T
|
|
488
468
|
|
|
489
469
|
|
|
490
470
|
def exponential_moving_demean(
|
|
491
471
|
data: NDArray, factor_new: float = 0.001, init_block_size: int | None = None
|
|
492
472
|
):
|
|
493
|
-
r"""Perform exponential moving
|
|
473
|
+
r"""Perform exponential moving demeanining.
|
|
494
474
|
|
|
495
|
-
Compute the
|
|
496
|
-
|
|
497
|
-
:math:`m_t = \frac{\sum_{i=0}^t (1-\alpha)^i x_{t-i}}{\sum_{i=0}^t (1-\alpha)^i}`
|
|
498
|
-
where :math:`\alpha` is ``factor_new``.
|
|
475
|
+
Compute the exponental moving mean :math:`m_t` at time `t` as
|
|
476
|
+
:math:`m_t=\mathrm{factornew} \cdot mean(x_t) + (1 - \mathrm{factornew}) \cdot m_{t-1}`.
|
|
499
477
|
|
|
500
|
-
|
|
478
|
+
Deman the data point :math:`x_t` at time `t` as:
|
|
501
479
|
:math:`x'_t=(x_t - m_t)`.
|
|
502
480
|
|
|
503
481
|
Parameters
|
|
@@ -512,24 +490,16 @@ def exponential_moving_demean(
|
|
|
512
490
|
demeaned: np.ndarray (n_channels, n_times)
|
|
513
491
|
Demeaned data.
|
|
514
492
|
"""
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
inv_alpha = 1.0 - alpha
|
|
521
|
-
|
|
522
|
-
d = lfilter([1.0], [1.0, -inv_alpha], np.ones(n_times))
|
|
523
|
-
|
|
524
|
-
n = lfilter([1.0], [1.0, -inv_alpha], data, axis=1)
|
|
525
|
-
meaned = n / d
|
|
526
|
-
demeaned = data - meaned
|
|
527
|
-
|
|
493
|
+
data = data.T
|
|
494
|
+
df = pd.DataFrame(data)
|
|
495
|
+
meaned = df.ewm(alpha=factor_new).mean()
|
|
496
|
+
demeaned = df - meaned
|
|
497
|
+
demeaned = np.array(demeaned)
|
|
528
498
|
if init_block_size is not None:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return demeaned
|
|
499
|
+
i_time_axis = 0
|
|
500
|
+
init_mean = np.mean(data[0:init_block_size], axis=i_time_axis, keepdims=True)
|
|
501
|
+
demeaned[0:init_block_size] = data[0:init_block_size] - init_mean
|
|
502
|
+
return demeaned.T
|
|
533
503
|
|
|
534
504
|
|
|
535
505
|
def filterbank(
|
|
@@ -384,42 +384,12 @@ def update_estimator_docstring(base_class, docstring):
|
|
|
384
384
|
return out_docstring
|
|
385
385
|
|
|
386
386
|
|
|
387
|
-
def _clean_docstring_sections(doc, remove_sections=("References",)):
|
|
388
|
-
"""Remove numpydoc-style sections that cause Sphinx build errors.
|
|
389
|
-
|
|
390
|
-
Numpydoc renders section headers as ``.. rubric::`` directives.
|
|
391
|
-
When the section body contains indented RST directives (e.g.
|
|
392
|
-
``.. footbibliography::`` or ``.. [citation]``), Sphinx errors
|
|
393
|
-
because rubric does not accept body content. Stripping these
|
|
394
|
-
sections from the *raw* docstring prevents numpydoc from
|
|
395
|
-
generating the problematic output.
|
|
396
|
-
"""
|
|
397
|
-
if not doc:
|
|
398
|
-
return doc or ""
|
|
399
|
-
|
|
400
|
-
for section in remove_sections:
|
|
401
|
-
# Match the section header + underline + body lines that follow.
|
|
402
|
-
# The body stops at the next numpydoc section (an optionally-indented
|
|
403
|
-
# word line followed by a dashes-only underline) or at end-of-string.
|
|
404
|
-
doc = re.sub(
|
|
405
|
-
rf"(\n[ \t]*){re.escape(section)}\n[ \t]*-+\n"
|
|
406
|
-
r"(?:(?![ \t]*\w[^\n]*\n[ \t]*-+)(?:[ \t]+[^\n]*\n|[ \t]*\n))*",
|
|
407
|
-
r"\1",
|
|
408
|
-
doc,
|
|
409
|
-
)
|
|
410
|
-
return doc
|
|
411
|
-
|
|
412
|
-
|
|
413
387
|
def _update_moabb_docstring(base_class, docstring):
|
|
414
388
|
base_doc = base_class.__doc__
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
)
|
|
420
|
-
# Strip dangling citation references (e.g. ``[1]_``) whose definitions
|
|
421
|
-
# were in the removed References section.
|
|
422
|
-
base_doc = re.sub(r"\s*\[\d+\]_", "", base_doc)
|
|
389
|
+
# Clean up malformed rubrics from moabb docstrings
|
|
390
|
+
# Remove lines that have ".. rubric::" followed by content on same line or improper formatting
|
|
391
|
+
|
|
392
|
+
base_doc = re.sub(r"\.\. rubric:: (.+?)\n\s+\.\. note::", r".. note::", base_doc)
|
|
423
393
|
out_docstring = base_doc + f"\n\n{docstring}"
|
|
424
394
|
return out_docstring
|
|
425
395
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.3.2.dev170355810"
|
{braindecode-1.3.2.dev168583761 → braindecode-1.3.2.dev170355810/braindecode.egg-info}/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.dev170355810
|
|
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.dev170355810}/braindecode.egg-info/SOURCES.txt
RENAMED
|
@@ -64,7 +64,6 @@ braindecode/models/contrawr.py
|
|
|
64
64
|
braindecode/models/ctnet.py
|
|
65
65
|
braindecode/models/deep4.py
|
|
66
66
|
braindecode/models/deepsleepnet.py
|
|
67
|
-
braindecode/models/dgcnn.py
|
|
68
67
|
braindecode/models/eegconformer.py
|
|
69
68
|
braindecode/models/eeginception_erp.py
|
|
70
69
|
braindecode/models/eeginception_mi.py
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
********
|
|
16
16
|
|
|
17
17
|
Model zoo availables in braindecode. The models are implemented as ``PyTorch``
|
|
18
|
-
:py:class:`torch.nn.
|
|
18
|
+
:py:class:`torch.nn.Modules` and can be used for various EEG decoding ways tasks.
|
|
19
19
|
|
|
20
20
|
All the models have the convention of having the signal related parameters named the
|
|
21
21
|
same way, following the braindecode's standards:
|
|
@@ -27,24 +27,23 @@ same way, following the braindecode's standards:
|
|
|
27
27
|
- (:fa:`clock`/ :fa:`wifi`\) ``input_window_seconds``: Length of the input window in
|
|
28
28
|
seconds.
|
|
29
29
|
- :fa:`info-circle` ``chs_info``: Information about each individual EEG channel. Refer
|
|
30
|
-
to :class:`mne.Info
|
|
30
|
+
to :class:`mne.Info["chs"]`.
|
|
31
31
|
|
|
32
32
|
All the models assume that the input data is a 3D tensor of shape ``(batch_size,
|
|
33
33
|
n_chans, n_times)``, and some models also accept a 4D tensor of shape ``(batch_size,
|
|
34
34
|
n_chans, n_times, n_epochs)``, in case of cropped model.
|
|
35
35
|
|
|
36
|
-
All the models are implemented as subclasses of
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
interface for all EEG models and can derive variable names when needed.
|
|
36
|
+
All the models are implemented as subclasses of :py:class:`EEGModuleMixin`, which is a
|
|
37
|
+
base class for all EEG models in Braindecode. The :class:`EEGModuleMixin` class provides
|
|
38
|
+
a common interface for all EEG models and derivate variables names if necessary.
|
|
40
39
|
|
|
41
40
|
.. important::
|
|
42
41
|
|
|
43
42
|
**Hugging Face Hub Integration**
|
|
44
43
|
|
|
45
44
|
All models in braindecode naturally possess the capability to push and pull from the
|
|
46
|
-
Hugging Face Hub through inheritance from
|
|
47
|
-
|
|
45
|
+
Hugging Face Hub through inheritance from :class:`PyTorchModelHubMixin`. This allows
|
|
46
|
+
you to:
|
|
48
47
|
|
|
49
48
|
- **Load pre-trained models** from the Hub using
|
|
50
49
|
``Model.from_pretrained("repo_id")``
|
|
@@ -101,8 +100,8 @@ interface for all EEG models and can derive variable names when needed.
|
|
|
101
100
|
repo_id="username/my-eegnex-model", commit_message="Initial model upload"
|
|
102
101
|
)
|
|
103
102
|
|
|
104
|
-
For more details, see the :class
|
|
105
|
-
|
|
103
|
+
For more details, see the :class:`EEGModuleMixin` documentation and the
|
|
104
|
+
:ref:`hub-integration` tutorial.
|
|
106
105
|
|
|
107
106
|
:note: Auto-generated Pydantic configs are available when the optional
|
|
108
107
|
``braindecode[pydantic]`` extra (which installs ``pydantic`` and ``numpydantic``) is
|
|
@@ -136,7 +135,6 @@ interface for all EEG models and can derive variable names when needed.
|
|
|
136
135
|
CBraMod
|
|
137
136
|
ContraWR
|
|
138
137
|
CTNet
|
|
139
|
-
DGCNN
|
|
140
138
|
Deep4Net
|
|
141
139
|
DeepSleepNet
|
|
142
140
|
EEGConformer
|