braindecode 1.6.0.dev1024__tar.gz → 1.6.0.dev1028__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.6.0.dev1024/braindecode.egg-info → braindecode-1.6.0.dev1028}/PKG-INFO +1 -1
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/contrawr.py +2 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/deepsleepnet.py +2 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegminer.py +2 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegsym.py +2 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/usleep.py +2 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/util.py +34 -0
- braindecode-1.6.0.dev1028/braindecode/version.py +1 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/whats_new.rst +8 -1
- braindecode-1.6.0.dev1024/braindecode/version.py +0 -1
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/LICENSE.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/MANIFEST.in +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/NOTICE.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/README.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/classifier.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/base.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub_io.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/hub_formats.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/util.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/functional/functions.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/base.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/bendr.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/biot.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/brainmodule.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/codebrain.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/config.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/deep4.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/dgcnn.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegpt.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/emg2qwerty.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/interpolated.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/labram.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/luna.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/medformer.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/meta_neuromotor.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/reve.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/summary.csv +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/tcn.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/activation.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/attention.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/filter.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/interpolation.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/layers.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/linear.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/stats.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/util.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/mne_preprocess.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/preprocess.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/regressor.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/samplers/base.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/training/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/training/losses.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/training/scoring.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/util.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/attribution.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/frequency.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/metrics.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/sanity.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/topology.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode.egg-info/SOURCES.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/Makefile +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/api.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/cite.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/conf.py +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/help.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/index.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/install/install.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/install/install_pip.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/install/install_source.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models_table.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/pyproject.toml +0 -0
- {braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.6.0.
|
|
3
|
+
Version: 1.6.0.dev1028
|
|
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>
|
|
@@ -5,6 +5,7 @@ import torch.nn as nn
|
|
|
5
5
|
from mne.utils import warn
|
|
6
6
|
|
|
7
7
|
from braindecode.models.base import EEGModuleMixin
|
|
8
|
+
from braindecode.models.util import _disable_batch_norm_training_if_batch_size_one
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class ContraWR(EEGModuleMixin, nn.Module):
|
|
@@ -122,6 +123,7 @@ class ContraWR(EEGModuleMixin, nn.Module):
|
|
|
122
123
|
self.activation_layer = activation()
|
|
123
124
|
self.final_layer = nn.Linear(emb_size, self.n_outputs)
|
|
124
125
|
|
|
126
|
+
@_disable_batch_norm_training_if_batch_size_one
|
|
125
127
|
def forward(self, X: torch.Tensor) -> torch.Tensor:
|
|
126
128
|
"""
|
|
127
129
|
Forward pass.
|
|
@@ -7,6 +7,7 @@ import torch.nn as nn
|
|
|
7
7
|
from einops.layers.torch import Rearrange
|
|
8
8
|
|
|
9
9
|
from braindecode.models.base import EEGModuleMixin
|
|
10
|
+
from braindecode.models.util import _disable_batch_norm_training_if_batch_size_one
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class DeepSleepNet(EEGModuleMixin, nn.Module):
|
|
@@ -289,6 +290,7 @@ class DeepSleepNet(EEGModuleMixin, nn.Module):
|
|
|
289
290
|
else nn.Linear(fc_out_features, self.n_outputs)
|
|
290
291
|
)
|
|
291
292
|
|
|
293
|
+
@_disable_batch_norm_training_if_batch_size_one
|
|
292
294
|
def forward(self, x):
|
|
293
295
|
if x.ndim == 3:
|
|
294
296
|
x = x.unsqueeze(1)
|
|
@@ -13,6 +13,7 @@ from torch import nn
|
|
|
13
13
|
|
|
14
14
|
import braindecode.functional as F
|
|
15
15
|
from braindecode.models.base import EEGModuleMixin
|
|
16
|
+
from braindecode.models.util import _disable_batch_norm_training_if_batch_size_one
|
|
16
17
|
from braindecode.modules import GeneralizedGaussianFilter
|
|
17
18
|
|
|
18
19
|
_eeg_miner_methods = ["mag", "corr", "plv"]
|
|
@@ -191,6 +192,7 @@ class EEGMiner(EEGModuleMixin, nn.Module):
|
|
|
191
192
|
self.final_layer = nn.Linear(self.n_features, self.n_outputs)
|
|
192
193
|
nn.init.zeros_(self.final_layer.bias)
|
|
193
194
|
|
|
195
|
+
@_disable_batch_norm_training_if_batch_size_one
|
|
194
196
|
def forward(self, x):
|
|
195
197
|
"""x: (batch, electrodes, time)"""
|
|
196
198
|
batch = x.shape[0]
|
|
@@ -11,6 +11,7 @@ from braindecode.datautil.channel_utils import (
|
|
|
11
11
|
match_hemisphere_chans,
|
|
12
12
|
)
|
|
13
13
|
from braindecode.models.base import EEGModuleMixin
|
|
14
|
+
from braindecode.models.util import _disable_batch_norm_training_if_batch_size_one
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class EEGSym(EEGModuleMixin, nn.Module):
|
|
@@ -363,6 +364,7 @@ class EEGSym(EEGModuleMixin, nn.Module):
|
|
|
363
364
|
out_features=self.n_outputs,
|
|
364
365
|
)
|
|
365
366
|
|
|
367
|
+
@_disable_batch_norm_training_if_batch_size_one
|
|
366
368
|
def forward(self, x):
|
|
367
369
|
"""Forward pass.
|
|
368
370
|
|
|
@@ -9,6 +9,7 @@ import torch
|
|
|
9
9
|
from torch import nn
|
|
10
10
|
|
|
11
11
|
from braindecode.models.base import EEGModuleMixin
|
|
12
|
+
from braindecode.models.util import _disable_batch_norm_training_if_batch_size_one
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class USleep(EEGModuleMixin, nn.Module):
|
|
@@ -295,6 +296,7 @@ class USleep(EEGModuleMixin, nn.Module):
|
|
|
295
296
|
# output is (B, n_classes, S)
|
|
296
297
|
)
|
|
297
298
|
|
|
299
|
+
@_disable_batch_norm_training_if_batch_size_one
|
|
298
300
|
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
299
301
|
"""If input x has shape (B, S, C, T), return y_pred of shape (B, n_classes, S).
|
|
300
302
|
If input x has shape (B, C, T), return y_pred of shape (B, n_classes).
|
|
@@ -12,6 +12,8 @@ from typing import Any, Dict, Literal, Optional, Sequence
|
|
|
12
12
|
import numpy as np
|
|
13
13
|
import pandas as pd
|
|
14
14
|
import pydantic
|
|
15
|
+
import torch # noqa: F401 # exposed so TorchScript can resolve ``torch`` through the BatchNorm-guard wrapper's __globals__
|
|
16
|
+
from torch import nn
|
|
15
17
|
|
|
16
18
|
models_dict = {}
|
|
17
19
|
|
|
@@ -23,6 +25,38 @@ _EEG_PARAMS = frozenset(
|
|
|
23
25
|
)
|
|
24
26
|
|
|
25
27
|
_JSON_SAFE = (int, float, str, bool, type(None))
|
|
28
|
+
_BATCH_NORM_MODULES = (
|
|
29
|
+
nn.BatchNorm1d,
|
|
30
|
+
nn.BatchNorm2d,
|
|
31
|
+
nn.BatchNorm3d,
|
|
32
|
+
nn.SyncBatchNorm,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _disable_batch_norm_training_if_batch_size_one(forward):
|
|
37
|
+
"""Temporarily set BatchNorm layers to train(False) for batch size one."""
|
|
38
|
+
forward_signature = inspect.signature(forward)
|
|
39
|
+
|
|
40
|
+
@wraps(forward)
|
|
41
|
+
def wrapped(self, *args, **kwargs):
|
|
42
|
+
bound = forward_signature.bind(self, *args, **kwargs)
|
|
43
|
+
x = next(value for name, value in bound.arguments.items() if name != "self")
|
|
44
|
+
batch_norms = []
|
|
45
|
+
if self.training and x.shape[0] == 1:
|
|
46
|
+
batch_norms = [
|
|
47
|
+
layer
|
|
48
|
+
for layer in self.modules()
|
|
49
|
+
if isinstance(layer, _BATCH_NORM_MODULES) and layer.training
|
|
50
|
+
]
|
|
51
|
+
for batch_norm in batch_norms:
|
|
52
|
+
batch_norm.train(False)
|
|
53
|
+
try:
|
|
54
|
+
return forward(self, *args, **kwargs)
|
|
55
|
+
finally:
|
|
56
|
+
for batch_norm in batch_norms:
|
|
57
|
+
batch_norm.train(True)
|
|
58
|
+
|
|
59
|
+
return wrapped
|
|
26
60
|
|
|
27
61
|
|
|
28
62
|
def _is_jsonable(val):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.6.0.dev1028"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.6.0.
|
|
3
|
+
Version: 1.6.0.dev1028
|
|
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>
|
|
@@ -41,7 +41,14 @@ Requirements
|
|
|
41
41
|
Bug fixes
|
|
42
42
|
==========
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- Fix :class:`~braindecode.models.ContraWR`,
|
|
45
|
+
:class:`~braindecode.models.DeepSleepNet`, and
|
|
46
|
+
:class:`~braindecode.models.EEGMiner` raising a confusing
|
|
47
|
+
:class:`ValueError` on ``batch_size=1`` forward passes in train mode due to
|
|
48
|
+
:class:`~torch.nn.BatchNorm1d` (and its 2D/3D variants) requiring more than
|
|
49
|
+
one sample per channel during training. The affected BatchNorm layers now
|
|
50
|
+
use running statistics when ``batch_size == 1`` in train mode.
|
|
51
|
+
By `Bruno Aristimunha`_.
|
|
45
52
|
|
|
46
53
|
Code health
|
|
47
54
|
============
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.6.0.dev1024"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/functional.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/augmentation/transforms.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/datasets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub_format.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/hub_validation.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/bids/iterable.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datasets/sleep_physionet.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/channel_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/datautil/serialization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/functional/initialization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/attentionbasenet.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eeginception_erp.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/eeginception_mi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/fblightconvnet.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/meta_neuromotor.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/models/patchedtransformer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/interpolation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/modules/parametrization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/mne_preprocess.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/preprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/preprocessing/windowers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/attribution.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/frequency.py
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/metrics.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode/visualization/topology.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/braindecode.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/class.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/_templates/autosummary/function.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/attention.rst
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/channel.rst
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/convolution.rst
RENAMED
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/filterbank.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/interpretable.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/categorization/recurrent.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models_categorization.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.6.0.dev1024 → braindecode-1.6.0.dev1028}/docs/models/models_visualization.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|