Braindecode 1.8.1.dev181501004__tar.gz → 1.8.1.dev181512403__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.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/NOTICE.txt +0 -3
- {braindecode-1.8.1.dev181501004/braindecode.egg-info → braindecode-1.8.1.dev181512403}/PKG-INFO +1 -1
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/augmentation/__init__.py +0 -2
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/augmentation/functional.py +0 -48
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/augmentation/transforms.py +1 -52
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/base.py +3 -69
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/eegneuralnet.py +1 -6
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/functional/functions.py +8 -19
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/__init__.py +0 -6
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/axon.py +8 -42
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/barista.py +11 -23
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/base.py +0 -18
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/brainmodule.py +1 -13
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/brant.py +7 -18
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/codebrain.py +15 -90
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/csbrain.py +12 -24
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/ctnet.py +1 -9
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eeg_clip.py +9 -71
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegconformer.py +1 -14
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegnex.py +2 -6
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegpt.py +8 -12
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegsym.py +16 -68
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/luna.py +3 -4
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/medformer.py +20 -47
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/mirepnet.py +4 -15
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/mscformer.py +1 -21
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/msvtnet.py +0 -115
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/neurorvq.py +31 -118
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/neurorvq_tokenizer.py +10 -30
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/reve.py +39 -117
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/signal_jepa.py +3 -81
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sinc_shallow.py +1 -2
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sleepfm.py +12 -62
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/steegformer.py +9 -16
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/summary.csv +0 -3
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tfm_tokenizer.py +3 -44
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/util.py +0 -8
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/zuna.py +1 -1
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/__init__.py +1 -2
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/attention.py +9 -71
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/blocks.py +5 -121
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/channels.py +0 -77
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/preprocess.py +0 -17
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/samplers/base.py +61 -60
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/training/losses.py +4 -5
- braindecode-1.8.1.dev181512403/braindecode/version.py +1 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode.egg-info/SOURCES.txt +0 -3
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/api.rst +0 -11
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/whats_new.rst +0 -93
- braindecode-1.8.1.dev181501004/braindecode/models/duin.py +0 -454
- braindecode-1.8.1.dev181501004/braindecode/models/epint.py +0 -315
- braindecode-1.8.1.dev181501004/braindecode/models/gcnsnet.py +0 -338
- braindecode-1.8.1.dev181501004/braindecode/version.py +0 -1
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/LICENSE.txt +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/MANIFEST.in +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/README.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/classifier.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/_notebook_viewer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/hub.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/hub_io.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/collate.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datautil/hub_formats.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datautil/util.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/functional/_real_dft.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/bendr.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/biot.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/brainbert.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/brainomni.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/config.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/dance.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/deep4.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/dgcnn.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/diver1.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegdino.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/emg2qwerty.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/guetschel2026.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/labram.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/mapa.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/meta_neuromotor.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/mvpformer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/neuropose.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/popt.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/seizure_transformer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sensingdynamics.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tcformer.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tcn.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tmsanet.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/usleep.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/vemg2pose.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/activation.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/dance_modules.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/filter.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/layers.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/linear.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/linear_attention.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/popt_modules.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/quantization.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/stats.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/util.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/mne_preprocess.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/regressor.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/training/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/training/scoring.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/util.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/activations.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/attribution.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/frequency.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/metrics.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/sanity.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/visualization/topology.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/Makefile +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/agent_docs.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/cite.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/conf.py +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/help.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/index.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/install/install.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/install/install_pip.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/install/install_source.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/models.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/models_table.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/docs/user_guide/channel_strategies.rst +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/pyproject.toml +0 -0
- {braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/setup.cfg +0 -0
|
@@ -40,7 +40,6 @@ The following components are licensed under the MIT License:
|
|
|
40
40
|
|
|
41
41
|
- `braindecode/models/ctnet.py`
|
|
42
42
|
- `braindecode/models/dance.py`
|
|
43
|
-
- `braindecode/models/duin.py`
|
|
44
43
|
- `braindecode/models/medformer.py`
|
|
45
44
|
- `braindecode/models/tcformer.py`
|
|
46
45
|
- `braindecode/models/ifnet.py`
|
|
@@ -55,8 +54,6 @@ The following components are licensed under the MIT License:
|
|
|
55
54
|
- `docs/_static/model/seizure_transformer_arch.png`
|
|
56
55
|
- `braindecode/models/guetschel2026.py`
|
|
57
56
|
- `braindecode/models/tmsanet.py`
|
|
58
|
-
- `braindecode/models/epint.py`
|
|
59
|
-
- `braindecode/models/gcnsnet.py`
|
|
60
57
|
|
|
61
58
|
The `brainomni.py` file is a derivative of `OpenTSLab/BrainOmni` (MIT), whose
|
|
62
59
|
SEANet codec derives from Meta's `facebookresearch/encodec` (MIT). The
|
{braindecode-1.8.1.dev181501004/braindecode.egg-info → braindecode-1.8.1.dev181512403}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.8.1.
|
|
3
|
+
Version: 1.8.1.dev181512403
|
|
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>
|
|
@@ -10,7 +10,6 @@ from .transforms import (
|
|
|
10
10
|
ChannelsReref,
|
|
11
11
|
ChannelsShuffle,
|
|
12
12
|
ChannelsSymmetry,
|
|
13
|
-
CutMix,
|
|
14
13
|
FrequencyShift,
|
|
15
14
|
FTSurrogate,
|
|
16
15
|
GaussianNoise,
|
|
@@ -37,7 +36,6 @@ __all__ = [
|
|
|
37
36
|
"SignFlip",
|
|
38
37
|
"FTSurrogate",
|
|
39
38
|
"ChannelsShuffle",
|
|
40
|
-
"CutMix",
|
|
41
39
|
"ChannelsDropout",
|
|
42
40
|
"GaussianNoise",
|
|
43
41
|
"ChannelsSymmetry",
|
|
@@ -1075,54 +1075,6 @@ def mixup(
|
|
|
1075
1075
|
return X_mix, (y_a, y_b, lam)
|
|
1076
1076
|
|
|
1077
1077
|
|
|
1078
|
-
def cutmix(
|
|
1079
|
-
X: torch.Tensor,
|
|
1080
|
-
y: torch.Tensor,
|
|
1081
|
-
idx_perm: torch.Tensor,
|
|
1082
|
-
cut_t_start: torch.Tensor,
|
|
1083
|
-
cut_t_len: torch.Tensor,
|
|
1084
|
-
) -> tuple[torch.Tensor, torch.Tensor]:
|
|
1085
|
-
"""Paste a time region of shuffled examples into the original examples.
|
|
1086
|
-
|
|
1087
|
-
See [1]_ for details.
|
|
1088
|
-
|
|
1089
|
-
Parameters
|
|
1090
|
-
----------
|
|
1091
|
-
X : torch.Tensor
|
|
1092
|
-
EEG data in form ``batch_size, n_channels, n_times``
|
|
1093
|
-
y : torch.Tensor
|
|
1094
|
-
Target of length ``batch_size``
|
|
1095
|
-
idx_perm : torch.Tensor
|
|
1096
|
-
Permuted indices of example that are mixed into original examples.
|
|
1097
|
-
cut_t_start : torch.Tensor
|
|
1098
|
-
Start index of the pasted time region for each example.
|
|
1099
|
-
cut_t_len : torch.Tensor
|
|
1100
|
-
Length of the pasted time region for each example.
|
|
1101
|
-
|
|
1102
|
-
Returns
|
|
1103
|
-
-------
|
|
1104
|
-
tuple
|
|
1105
|
-
``X``, ``y``. Where ``X`` is augmented and ``y`` is a tuple of length
|
|
1106
|
-
3 containing the labels of the two mixed examples and the fraction of
|
|
1107
|
-
each example kept from the original, ``1 - cut_t_len / n_times``.
|
|
1108
|
-
|
|
1109
|
-
References
|
|
1110
|
-
----------
|
|
1111
|
-
.. [1] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun,
|
|
1112
|
-
Junsuk Choe, Youngjoon Yoo (2019). CutMix: Regularization Strategy
|
|
1113
|
-
to Train Strong Classifiers with Localizable Features. In 2019
|
|
1114
|
-
IEEE/CVF International Conference on Computer Vision (ICCV)
|
|
1115
|
-
Online: https://arxiv.org/abs/1905.04899
|
|
1116
|
-
"""
|
|
1117
|
-
n_times = X.shape[-1]
|
|
1118
|
-
t = torch.arange(n_times, device=X.device)
|
|
1119
|
-
start = cut_t_start[:, None]
|
|
1120
|
-
in_cut = (t >= start) & (t < start + cut_t_len[:, None])
|
|
1121
|
-
X_mix = torch.where(in_cut[:, None], X[idx_perm], X)
|
|
1122
|
-
lam = (n_times - cut_t_len).to(X.dtype) / n_times
|
|
1123
|
-
return X_mix, (y.clone(), y[idx_perm].clone(), lam)
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
1078
|
def segmentation_reconstruction(
|
|
1127
1079
|
X: torch.Tensor,
|
|
1128
1080
|
y: torch.Tensor,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
# Gustavo Rodrigues <gustavenrique01@gmail.com>
|
|
4
4
|
# Bruna Lopes <brunajaflopes@gmail.com>
|
|
5
5
|
# Sarthak Tayal <sarthaktayal2@gmail.com>
|
|
6
|
-
# Anton Soloviev <anton@praviel.com>
|
|
7
6
|
#
|
|
8
7
|
# License: BSD (3-clause)
|
|
9
8
|
|
|
@@ -25,7 +24,6 @@ from .functional import (
|
|
|
25
24
|
channels_permute,
|
|
26
25
|
channels_rereference,
|
|
27
26
|
channels_shuffle,
|
|
28
|
-
cutmix,
|
|
29
27
|
frequency_shift,
|
|
30
28
|
ft_surrogate,
|
|
31
29
|
gaussian_noise,
|
|
@@ -1097,55 +1095,6 @@ class Mixup(Transform):
|
|
|
1097
1095
|
}
|
|
1098
1096
|
|
|
1099
1097
|
|
|
1100
|
-
class CutMix(Mixup):
|
|
1101
|
-
"""Implements CutMix for EEG data.
|
|
1102
|
-
|
|
1103
|
-
A random time region of each example is replaced by the same region of
|
|
1104
|
-
a shuffled example of the batch, see [1]_. As in the reference code [2]_,
|
|
1105
|
-
a coefficient ``lam`` is drawn from a Beta distribution, the region is
|
|
1106
|
-
``(1 - lam) * n_times`` long (the 1-D analogue of the cut area ratio
|
|
1107
|
-
``1 - lam``) around a uniformly drawn center, it is clipped at the trial
|
|
1108
|
-
boundaries, and ``lam`` is then recomputed from the pasted length.
|
|
1109
|
-
|
|
1110
|
-
Like :class:`Mixup`, it applies to whole batches and returns targets
|
|
1111
|
-
``(y_a, y_b, lam)`` for :func:`braindecode.training.mixup_criterion`.
|
|
1112
|
-
|
|
1113
|
-
Parameters
|
|
1114
|
-
----------
|
|
1115
|
-
alpha : float
|
|
1116
|
-
Parameter of the Beta distribution of ``lam``. ``alpha <= 0`` cuts
|
|
1117
|
-
nothing.
|
|
1118
|
-
beta_per_sample : bool (default=False)
|
|
1119
|
-
By default, one ``lam`` per batch is drawn. If True, one per sample.
|
|
1120
|
-
random_state : int | numpy.random.Generator, optional
|
|
1121
|
-
Seed to be used to instantiate numpy random number generator instance.
|
|
1122
|
-
Defaults to None.
|
|
1123
|
-
|
|
1124
|
-
References
|
|
1125
|
-
----------
|
|
1126
|
-
.. [1] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun,
|
|
1127
|
-
Junsuk Choe, Youngjoon Yoo (2019). CutMix: Regularization Strategy
|
|
1128
|
-
to Train Strong Classifiers with Localizable Features. In 2019
|
|
1129
|
-
IEEE/CVF International Conference on Computer Vision (ICCV)
|
|
1130
|
-
Online: https://arxiv.org/abs/1905.04899
|
|
1131
|
-
.. [2] https://github.com/clovaai/CutMix-PyTorch/blob/master/train.py
|
|
1132
|
-
"""
|
|
1133
|
-
|
|
1134
|
-
operation = staticmethod(cutmix) # type: ignore[assignment]
|
|
1135
|
-
|
|
1136
|
-
def get_augmentation_params(self, *batch):
|
|
1137
|
-
"""Return idx_perm and the cut_t_start, cut_t_len of each region."""
|
|
1138
|
-
params = super().get_augmentation_params(*batch)
|
|
1139
|
-
lam = params.pop("lam")
|
|
1140
|
-
n_times = batch[0].shape[-1]
|
|
1141
|
-
half = ((1 - lam) * n_times).long() // 2
|
|
1142
|
-
center = torch.as_tensor(self.rng.randint(n_times, size=len(lam)))
|
|
1143
|
-
center = center.to(lam.device)
|
|
1144
|
-
start = (center - half).clamp(min=0)
|
|
1145
|
-
end = (center + half).clamp(max=n_times)
|
|
1146
|
-
return dict(params, cut_t_start=start, cut_t_len=end - start)
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
1098
|
class SegmentationReconstruction(Transform):
|
|
1150
1099
|
"""Segmentation Reconstruction from Lotte (2015) [Lotte2015]_.
|
|
1151
1100
|
|
|
@@ -1334,7 +1283,7 @@ class MaskEncoding(Transform):
|
|
|
1334
1283
|
)
|
|
1335
1284
|
|
|
1336
1285
|
time_start = self.rng.randint(
|
|
1337
|
-
0, n_times - segment_length
|
|
1286
|
+
0, n_times - segment_length, (batch_size, self.n_segments)
|
|
1338
1287
|
)
|
|
1339
1288
|
time_start = torch.from_numpy(time_start)
|
|
1340
1289
|
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/datasets/base.py
RENAMED
|
@@ -1281,49 +1281,6 @@ class WindowsDataset(_ZarrMixin, RecordDataset):
|
|
|
1281
1281
|
)
|
|
1282
1282
|
|
|
1283
1283
|
|
|
1284
|
-
def _lazy_source_files(ds) -> list:
|
|
1285
|
-
"""Return the files ``ds`` still reads its signal from (none once preloaded)."""
|
|
1286
|
-
signal = ds.raw if hasattr(ds, "raw") else getattr(ds, "windows", None)
|
|
1287
|
-
if signal is None or getattr(signal, "preload", True):
|
|
1288
|
-
return []
|
|
1289
|
-
files = list(
|
|
1290
|
-
getattr(signal, "filenames", None) or [getattr(signal, "filename", None)]
|
|
1291
|
-
)
|
|
1292
|
-
raw = getattr(signal, "_raw", None)
|
|
1293
|
-
if isinstance(raw, mne.io.BaseRaw) and not raw.preload:
|
|
1294
|
-
files += raw.filenames # mne.Epochs of a lazily read Raw read through it
|
|
1295
|
-
return [f for f in files if f is not None]
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
def _dir_key(directory):
|
|
1299
|
-
"""Identify a directory by device and inode, whatever its spelling."""
|
|
1300
|
-
stat = os.stat(directory)
|
|
1301
|
-
return stat.st_dev, stat.st_ino
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
def _overwrite_conflicts(datasets, path, offset):
|
|
1305
|
-
"""Yield ``(i_ds, i_target, target_dir)`` for each dataset ``i_ds`` that
|
|
1306
|
-
lazily reads from inside ``target_dir = path/<i_target + offset>``, which
|
|
1307
|
-
``save(overwrite=True)`` deletes before writing dataset ``i_target``.
|
|
1308
|
-
"""
|
|
1309
|
-
targets = {}
|
|
1310
|
-
for i in range(len(datasets)):
|
|
1311
|
-
target_dir = os.path.join(path, str(i + offset))
|
|
1312
|
-
if os.path.isdir(target_dir):
|
|
1313
|
-
targets[_dir_key(target_dir)] = (i, target_dir)
|
|
1314
|
-
if not targets:
|
|
1315
|
-
return
|
|
1316
|
-
for i_ds, ds in enumerate(datasets):
|
|
1317
|
-
for file in _lazy_source_files(ds):
|
|
1318
|
-
# ancestors of the name and of the file it links to (DataLad)
|
|
1319
|
-
parents = {
|
|
1320
|
-
*Path(os.path.abspath(file)).parents,
|
|
1321
|
-
*Path(os.path.realpath(file)).parents,
|
|
1322
|
-
}
|
|
1323
|
-
for key in {_dir_key(p) for p in parents if p.is_dir()} & targets.keys():
|
|
1324
|
-
yield (i_ds, *targets[key])
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
1284
|
@register_dataset
|
|
1328
1285
|
class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
1329
1286
|
"""A base class for concatenated datasets.
|
|
@@ -1561,9 +1518,7 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1561
1518
|
metadata : pd.DataFrame
|
|
1562
1519
|
DataFrame containing as many rows as there are windows in the
|
|
1563
1520
|
BaseConcatDataset, with the metadata and description information
|
|
1564
|
-
for each window
|
|
1565
|
-
in ``datasets`` of the dataset (recording) each window comes from.
|
|
1566
|
-
Samplers use it to keep recordings apart.
|
|
1521
|
+
for each window.
|
|
1567
1522
|
"""
|
|
1568
1523
|
if not all(
|
|
1569
1524
|
[
|
|
@@ -1589,15 +1544,9 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1589
1544
|
"Dataset descriptions cannot contain the reserved window "
|
|
1590
1545
|
"metadata key 'i_trial_in_dataset'."
|
|
1591
1546
|
)
|
|
1592
|
-
if "i_dataset" in df.columns or "i_dataset" in ds.description:
|
|
1593
|
-
raise ValueError(
|
|
1594
|
-
"Window metadata and dataset descriptions cannot contain the "
|
|
1595
|
-
"key 'i_dataset', which get_metadata() reserves for the "
|
|
1596
|
-
"position of the dataset each window comes from. Rename it."
|
|
1597
|
-
)
|
|
1598
1547
|
|
|
1599
1548
|
all_dfs = list()
|
|
1600
|
-
for
|
|
1549
|
+
for ds in self.datasets:
|
|
1601
1550
|
if hasattr(ds, "_windows") and ds._windows is not None:
|
|
1602
1551
|
df = ds._windows.metadata
|
|
1603
1552
|
else:
|
|
@@ -1607,7 +1556,6 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1607
1556
|
df = df.copy()
|
|
1608
1557
|
for k, v in ds.description.items():
|
|
1609
1558
|
df[k] = v
|
|
1610
|
-
df["i_dataset"] = i_ds
|
|
1611
1559
|
all_dfs.append(df)
|
|
1612
1560
|
|
|
1613
1561
|
return pd.concat(all_dfs)
|
|
@@ -1900,11 +1848,6 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1900
1848
|
dataset description.
|
|
1901
1849
|
"""
|
|
1902
1850
|
description = pd.DataFrame(description)
|
|
1903
|
-
if len(description.columns) and len(description) != len(self.datasets):
|
|
1904
|
-
raise ValueError(
|
|
1905
|
-
f"Length of values ({len(description)}) does not match "
|
|
1906
|
-
f"number of datasets ({len(self.datasets)})."
|
|
1907
|
-
)
|
|
1908
1851
|
for key, value in description.items():
|
|
1909
1852
|
for ds, value_ in zip(self.datasets, value):
|
|
1910
1853
|
ds.set_description({key: value_}, overwrite=overwrite)
|
|
@@ -1935,9 +1878,7 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1935
1878
|
-raw.fif | -epo.fif and .json files to.
|
|
1936
1879
|
overwrite : bool
|
|
1937
1880
|
Whether to delete old subdirectories that will be saved to in this
|
|
1938
|
-
call.
|
|
1939
|
-
``ValueError`` is raised before anything is deleted: load the data
|
|
1940
|
-
into memory first (``preload=True``) or save to another directory.
|
|
1881
|
+
call.
|
|
1941
1882
|
offset : int
|
|
1942
1883
|
If provided, the integer is added to the id of the dataset in the
|
|
1943
1884
|
concat. This is useful in the setting of very large datasets, where
|
|
@@ -1950,13 +1891,6 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1950
1891
|
hasattr(self.datasets[0], "raw") or hasattr(self.datasets[0], "windows")
|
|
1951
1892
|
):
|
|
1952
1893
|
raise ValueError("dataset should have either raw or windows attribute")
|
|
1953
|
-
if overwrite:
|
|
1954
|
-
for _, _, target_dir in _overwrite_conflicts(self.datasets, path, offset):
|
|
1955
|
-
raise ValueError(
|
|
1956
|
-
f"Saving with overwrite=True would delete {target_dir} while "
|
|
1957
|
-
"a dataset still reads its data from it. Load the data into "
|
|
1958
|
-
"memory first (preload=True) or save to another directory."
|
|
1959
|
-
)
|
|
1960
1894
|
|
|
1961
1895
|
# Create path if it doesn't exist
|
|
1962
1896
|
os.makedirs(path, exist_ok=True)
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/eegneuralnet.py
RENAMED
|
@@ -201,17 +201,12 @@ class _EEGNeuralNet(NeuralNet, abc.ABC):
|
|
|
201
201
|
if classes is None:
|
|
202
202
|
classes = getattr(self, "classes", None)
|
|
203
203
|
signal_kwargs = infer_signal_properties(X, y, mode=self.mode, classes=classes)
|
|
204
|
-
module = _get_model(self.module)
|
|
205
|
-
# Model-specific values computed from the data (e.g. GCNsNet's graph);
|
|
206
|
-
# the signal properties take precedence.
|
|
207
|
-
infer_model_kwargs = getattr(module, "_infer_model_kwargs", None)
|
|
208
|
-
if infer_model_kwargs is not None:
|
|
209
|
-
signal_kwargs = {**infer_model_kwargs(X, y), **signal_kwargs}
|
|
210
204
|
if not signal_kwargs:
|
|
211
205
|
return
|
|
212
206
|
|
|
213
207
|
# kick out missing kwargs:
|
|
214
208
|
module_kwargs = dict()
|
|
209
|
+
module = _get_model(self.module)
|
|
215
210
|
all_module_kwargs = inspect.signature(module.__init__).parameters.keys()
|
|
216
211
|
for k, v in signal_kwargs.items():
|
|
217
212
|
if v is None:
|
|
@@ -91,27 +91,16 @@ def fft_conv1d(
|
|
|
91
91
|
n_fft = 2 * _next_fast_len((n_times + kernel_size) // 2)
|
|
92
92
|
xs = spectral_input(x)
|
|
93
93
|
# conv1d is a cross-correlation: a convolution with the flipped kernel
|
|
94
|
-
x_f = torch.fft.rfft(xs, n=n_fft) # (batch, in
|
|
94
|
+
x_f = torch.fft.rfft(xs, n=n_fft).permute(2, 0, 1) # (freq, batch, in)
|
|
95
95
|
w_f = torch.fft.rfft(weight.to(xs).flip(-1), n=n_fft).permute(2, 1, 0)
|
|
96
96
|
# Per frequency (batch, in) @ (in, out) in complex numbers, as one real
|
|
97
|
-
# matmul (a complex one is slower on CPU)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
y_f = torch.view_as_real(x_f).permute(2, 0, 3, 1).flatten(2) @ w_mat.flatten(2)
|
|
105
|
-
y_f = torch.view_as_complex(y_f.unflatten(-1, [-1, 2]))
|
|
106
|
-
else:
|
|
107
|
-
# Forward only with fewer rows than twice the input channels: the
|
|
108
|
-
# doubled weight costs more than combining [Re x; Im x] @ [Re w, Im w].
|
|
109
|
-
x_f = x_f.permute(2, 0, 1)
|
|
110
|
-
p = torch.cat([x_f.real, x_f.imag], 1) @ torch.view_as_real(w_f).flatten(2)
|
|
111
|
-
p = p.unflatten(1, [2, x.shape[0]]).unflatten(3, [-1, 2])
|
|
112
|
-
y_f = torch.complex(
|
|
113
|
-
p[:, 0, :, :, 0] - p[:, 1, :, :, 1], p[:, 0, :, :, 1] + p[:, 1, :, :, 0]
|
|
114
|
-
)
|
|
97
|
+
# matmul (a complex one is slower on CPU): [Re x; Im x] @ [Re w, Im w]
|
|
98
|
+
# (columns interleaved) holds the four real products.
|
|
99
|
+
p = torch.cat([x_f.real, x_f.imag], 1) @ torch.view_as_real(w_f).flatten(2)
|
|
100
|
+
p = p.unflatten(1, [2, x.shape[0]]).unflatten(3, [-1, 2]) # x re/im, w re/im
|
|
101
|
+
y_f = torch.complex(
|
|
102
|
+
p[:, 0, :, :, 0] - p[:, 1, :, :, 1], p[:, 0, :, :, 1] + p[:, 1, :, :, 0]
|
|
103
|
+
)
|
|
115
104
|
y = torch.fft.irfft(y_f.permute(1, 2, 0), n=n_fft)
|
|
116
105
|
# "same" output t is sample t + kernel_size // 2 of the full convolution
|
|
117
106
|
y = y[..., kernel_size // 2 : kernel_size // 2 + n_times]
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/__init__.py
RENAMED
|
@@ -22,7 +22,6 @@ from .deep4 import Deep4Net
|
|
|
22
22
|
from .deepsleepnet import DeepSleepNet
|
|
23
23
|
from .dgcnn import DGCNN
|
|
24
24
|
from .diver1 import DIVER1
|
|
25
|
-
from .duin import DuIN
|
|
26
25
|
from .eeg_clip import EEGCLIP
|
|
27
26
|
from .eegconformer import EEGConformer
|
|
28
27
|
from .eegdino import EEGDINO
|
|
@@ -37,11 +36,9 @@ from .eegsimpleconv import EEGSimpleConv
|
|
|
37
36
|
from .eegsym import EEGSym
|
|
38
37
|
from .eegtcnet import EEGTCNet
|
|
39
38
|
from .emg2qwerty import EMG2QwertyNet
|
|
40
|
-
from .epint import EpiNT
|
|
41
39
|
from .fbcnet import FBCNet
|
|
42
40
|
from .fblightconvnet import FBLightConvNet
|
|
43
41
|
from .fbmsnet import FBMSNet
|
|
44
|
-
from .gcnsnet import GCNsNet
|
|
45
42
|
from .guetschel2026 import Guetschel2026
|
|
46
43
|
from .hybrid import HybridNet
|
|
47
44
|
from .ifnet import IFNet
|
|
@@ -120,7 +117,6 @@ __all__ = [
|
|
|
120
117
|
"Deep4Net",
|
|
121
118
|
"DeepSleepNet",
|
|
122
119
|
"DIVER1",
|
|
123
|
-
"DuIN",
|
|
124
120
|
"BrainModule",
|
|
125
121
|
"Brant",
|
|
126
122
|
"EEGCLIP",
|
|
@@ -138,14 +134,12 @@ __all__ = [
|
|
|
138
134
|
"EEGTCNet",
|
|
139
135
|
"DGCNN",
|
|
140
136
|
"EMG2QwertyNet",
|
|
141
|
-
"EpiNT",
|
|
142
137
|
"NeuroPose",
|
|
143
138
|
"SensingDynamics",
|
|
144
139
|
"VEMG2Pose",
|
|
145
140
|
"FBCNet",
|
|
146
141
|
"FBLightConvNet",
|
|
147
142
|
"FBMSNet",
|
|
148
|
-
"GCNsNet",
|
|
149
143
|
"Guetschel2026",
|
|
150
144
|
"MetaNeuromotorHand",
|
|
151
145
|
"HybridNet",
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/axon.py
RENAMED
|
@@ -14,7 +14,6 @@ from torch import nn
|
|
|
14
14
|
from braindecode.functional import sinusoidal_positional_encoding
|
|
15
15
|
from braindecode.models.base import EEGModuleMixin
|
|
16
16
|
from braindecode.models.util import warn_if_sfreq_differs
|
|
17
|
-
from braindecode.modules.attention import _scaled_dot_product_attention
|
|
18
17
|
from braindecode.modules.channels import _resolve
|
|
19
18
|
|
|
20
19
|
|
|
@@ -463,33 +462,11 @@ class _AxisAttention(nn.Module):
|
|
|
463
462
|
.unbind(0)
|
|
464
463
|
)
|
|
465
464
|
drop = self.att_drop_prob if self.training else 0.0
|
|
466
|
-
attended =
|
|
465
|
+
attended = F.scaled_dot_product_attention(
|
|
467
466
|
query, key, value, attn_mask=mask, dropout_p=drop
|
|
468
467
|
)
|
|
469
468
|
return attended.transpose(1, 2).reshape(n_seq, length, -1)
|
|
470
469
|
|
|
471
|
-
def _attend_two_scales(
|
|
472
|
-
self, projected: torch.Tensor, band: torch.Tensor, weights: torch.Tensor
|
|
473
|
-
) -> torch.Tensor:
|
|
474
|
-
"""Banded and full attention from one score matrix, mixed per query.
|
|
475
|
-
|
|
476
|
-
``weights`` (N, L, 2) are the scale-gate weights. Both softmaxes share
|
|
477
|
-
the scores and one product with the values serves the mixture.
|
|
478
|
-
"""
|
|
479
|
-
n_seq, length, _ = projected.shape
|
|
480
|
-
query, key, value = (
|
|
481
|
-
projected.reshape(n_seq, length, 3, self.num_heads, self.head_dim)
|
|
482
|
-
.permute(2, 0, 3, 1, 4)
|
|
483
|
-
.unbind(0)
|
|
484
|
-
)
|
|
485
|
-
scores = torch.matmul(query, key.transpose(-2, -1)) * self.head_dim**-0.5
|
|
486
|
-
weights = weights.reshape(n_seq, 1, length, 2)
|
|
487
|
-
probs = weights[..., 0:1] * scores.masked_fill(~band, float("-inf")).softmax(
|
|
488
|
-
-1
|
|
489
|
-
) + weights[..., 1:2] * scores.softmax(-1)
|
|
490
|
-
attended = torch.matmul(probs, value)
|
|
491
|
-
return attended.transpose(1, 2).reshape(n_seq, length, -1)
|
|
492
|
-
|
|
493
470
|
def forward(self, x: torch.Tensor, band: Optional[torch.Tensor]) -> torch.Tensor:
|
|
494
471
|
batch, n_chans, n_patches, dim = x.shape
|
|
495
472
|
axis_weights = self.axis_gate(x) # (B, C, P, 2)
|
|
@@ -499,26 +476,15 @@ class _AxisAttention(nn.Module):
|
|
|
499
476
|
# the restricted branch is the full one; attend once unless the two
|
|
500
477
|
# branches draw their own attention dropout.
|
|
501
478
|
per_channel = self.temporal_qkv(x.reshape(batch * n_chans, n_patches, dim))
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
batch, n_chans, n_patches, dim
|
|
509
|
-
)
|
|
510
|
-
else:
|
|
511
|
-
restricted = self.temporal_out(self._attend(per_channel, band)).reshape(
|
|
479
|
+
restricted = self.temporal_out(self._attend(per_channel, band)).reshape(
|
|
480
|
+
batch, n_chans, n_patches, dim
|
|
481
|
+
)
|
|
482
|
+
full = restricted
|
|
483
|
+
if band is not None or (self.training and self.att_drop_prob > 0):
|
|
484
|
+
full = self.temporal_out(self._attend(per_channel, None)).reshape(
|
|
512
485
|
batch, n_chans, n_patches, dim
|
|
513
486
|
)
|
|
514
|
-
|
|
515
|
-
if dropout:
|
|
516
|
-
full = self.temporal_out(self._attend(per_channel, None)).reshape(
|
|
517
|
-
batch, n_chans, n_patches, dim
|
|
518
|
-
)
|
|
519
|
-
temporal = (
|
|
520
|
-
scale_weights[..., 0:1] * restricted + scale_weights[..., 1:2] * full
|
|
521
|
-
)
|
|
487
|
+
temporal = scale_weights[..., 0:1] * restricted + scale_weights[..., 1:2] * full
|
|
522
488
|
|
|
523
489
|
# Spatial path: one sequence of C tokens per time step.
|
|
524
490
|
per_step = self.spatial_qkv(
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/barista.py
RENAMED
|
@@ -14,7 +14,6 @@ from braindecode.models.base import EEGModuleMixin
|
|
|
14
14
|
from braindecode.models.util import extract_channel_locations_from_chs_info
|
|
15
15
|
from braindecode.modules import GatedLinearUnit, PatchTokenizer
|
|
16
16
|
from braindecode.modules.attention import _scaled_dot_product_attention
|
|
17
|
-
from braindecode.modules.blocks import _check_on_non_divisible, _patch_count
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
@@ -78,8 +77,7 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
78
77
|
.. rubric:: Temporal, Spatial, and Spectral Encoding
|
|
79
78
|
|
|
80
79
|
- Temporal encoding uses non-overlapping patches and patch-index rotary
|
|
81
|
-
embeddings.
|
|
82
|
-
``on_non_divisible="crop"`` drops it, as the reference does.
|
|
80
|
+
embeddings. Samples beyond the last complete patch are dropped.
|
|
83
81
|
- Spatial encoding uses dataset-provided coordinate or region indices.
|
|
84
82
|
``spatial_scale="none"`` disables it.
|
|
85
83
|
- The CNN operates on waveforms. There is no explicit spectral transform.
|
|
@@ -96,8 +94,7 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
96
94
|
Treebank's coordinate convention.
|
|
97
95
|
|
|
98
96
|
With ``pooling="mean"``, channel counts and window lengths can vary between
|
|
99
|
-
batches
|
|
100
|
-
full patch). Pass each recording's
|
|
97
|
+
batches, provided each window contains a full patch. Pass each recording's
|
|
101
98
|
indices to :meth:`forward`; otherwise it uses the constructor's indices
|
|
102
99
|
or MNE positions. All samples in one batch
|
|
103
100
|
share a montage. The encoder uses PyTorch attention on separate batch
|
|
@@ -144,13 +141,9 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
144
141
|
in millimetres when deriving indices from ``chs_info``.
|
|
145
142
|
patch_size : int
|
|
146
143
|
Number of samples per temporal patch, default 512 (250 ms at the
|
|
147
|
-
paper's 2048 Hz).
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
is not a multiple of ``patch_size`` (right zero-pad, crop, or raise).
|
|
151
|
-
The reference implementation crops (``"crop"``: the trailing samples
|
|
152
|
-
are lost); both give the same model and output when ``n_times`` is a
|
|
153
|
-
multiple of ``patch_size``.
|
|
144
|
+
paper's 2048 Hz). Windows are tokenized into whole patches, so a window
|
|
145
|
+
that is not a multiple of ``patch_size`` loses its trailing samples, as
|
|
146
|
+
in the reference.
|
|
154
147
|
d_model : int
|
|
155
148
|
Token embedding dimension.
|
|
156
149
|
n_layers : int
|
|
@@ -187,9 +180,6 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
187
180
|
Systems 38. https://arxiv.org/abs/2512.12135
|
|
188
181
|
"""
|
|
189
182
|
|
|
190
|
-
# Configs and checkpoints saved before ``on_non_divisible`` existed cropped.
|
|
191
|
-
_legacy_on_non_divisible = "crop"
|
|
192
|
-
|
|
193
183
|
def __init__(
|
|
194
184
|
self,
|
|
195
185
|
# --- signal-related (handled by EEGModuleMixin) ---
|
|
@@ -205,7 +195,6 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
205
195
|
spatial_indices: list[int] | list[list[int]] | None = None,
|
|
206
196
|
coord_bins: int = 200,
|
|
207
197
|
patch_size: int = 512,
|
|
208
|
-
on_non_divisible: str = "pad",
|
|
209
198
|
d_model: int = 64,
|
|
210
199
|
n_layers: int = 12,
|
|
211
200
|
num_heads: int = 4,
|
|
@@ -254,7 +243,8 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
254
243
|
raise ValueError(f"{name} must be positive, got {value}.")
|
|
255
244
|
if cnn_depth < 0:
|
|
256
245
|
raise ValueError(f"cnn_depth must be non-negative, got {cnn_depth}.")
|
|
257
|
-
|
|
246
|
+
if self.n_times < patch_size:
|
|
247
|
+
raise ValueError("n_times must contain at least one full patch.")
|
|
258
248
|
if d_model % num_heads:
|
|
259
249
|
raise ValueError(
|
|
260
250
|
f"d_model ({d_model}) must be divisible by num_heads ({num_heads})."
|
|
@@ -268,7 +258,6 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
268
258
|
self.spatial_scale = spatial_scale
|
|
269
259
|
self.coord_bins = coord_bins
|
|
270
260
|
self.patch_size = patch_size
|
|
271
|
-
self.on_non_divisible = on_non_divisible
|
|
272
261
|
self.d_model = d_model
|
|
273
262
|
self.n_layers = n_layers
|
|
274
263
|
self.num_heads = num_heads
|
|
@@ -277,15 +266,14 @@ class BaRISTA(EEGModuleMixin, nn.Module, license="other"):
|
|
|
277
266
|
self.drop_prob = drop_prob
|
|
278
267
|
self.activation = activation
|
|
279
268
|
|
|
280
|
-
#
|
|
281
|
-
#
|
|
282
|
-
|
|
283
|
-
self.n_patches = _patch_count(self.n_times, patch_size, on_non_divisible)
|
|
269
|
+
# The trailing samples are dropped when n_times is not a multiple of
|
|
270
|
+
# patch_size, as in the reference.
|
|
271
|
+
self.n_patches = self.n_times // patch_size
|
|
284
272
|
|
|
285
273
|
self.patch_tokenizer = PatchTokenizer(
|
|
286
274
|
patch_size=patch_size,
|
|
287
275
|
n_times=self.n_times,
|
|
288
|
-
on_non_divisible=
|
|
276
|
+
on_non_divisible="crop",
|
|
289
277
|
output_order="patch_channel",
|
|
290
278
|
)
|
|
291
279
|
# Every (patch, channel) pair is encoded independently, so the grid is
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/base.py
RENAMED
|
@@ -608,24 +608,9 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
|
|
|
608
608
|
"""
|
|
609
609
|
config = dict(config) # shallow copy
|
|
610
610
|
config.pop("braindecode_version", None)
|
|
611
|
-
cls._fill_legacy_defaults(config)
|
|
612
611
|
resolve_type_kwargs(cls, config)
|
|
613
612
|
return cls(**config)
|
|
614
613
|
|
|
615
|
-
@classmethod
|
|
616
|
-
def _fill_legacy_defaults(cls, kwargs: dict) -> None:
|
|
617
|
-
"""Rebuild configs saved before ``on_non_divisible`` existed as they were.
|
|
618
|
-
|
|
619
|
-
Models that used to crop a time axis not divisible by their patch size
|
|
620
|
-
set ``_legacy_on_non_divisible = "crop"``. A saved config or checkpoint
|
|
621
|
-
without the ``on_non_divisible`` key then loads with ``"crop"``, so its
|
|
622
|
-
head and position tables keep their shapes; a new model defaults to
|
|
623
|
-
``"pad"``.
|
|
624
|
-
"""
|
|
625
|
-
legacy = getattr(cls, "_legacy_on_non_divisible", None)
|
|
626
|
-
if legacy is not None and "on_non_divisible" not in kwargs:
|
|
627
|
-
kwargs["on_non_divisible"] = legacy
|
|
628
|
-
|
|
629
614
|
def _set_n_outputs(self, n_outputs: int) -> None:
|
|
630
615
|
"""Record a new ``n_outputs`` on the model and its saved configs.
|
|
631
616
|
|
|
@@ -926,9 +911,6 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
|
|
|
926
911
|
):
|
|
927
912
|
model_kwargs.pop("braindecode_version", None)
|
|
928
913
|
filename = model_kwargs.pop("filename", None)
|
|
929
|
-
# The Hub mixin passes only the keys of config.json (plus the
|
|
930
|
-
# caller's), so a missing key means a pre-on_non_divisible save.
|
|
931
|
-
cls._fill_legacy_defaults(model_kwargs)
|
|
932
914
|
resolve_type_kwargs(cls, model_kwargs)
|
|
933
915
|
|
|
934
916
|
# Read saved n_outputs from config.json to detect when the
|
{braindecode-1.8.1.dev181501004 → braindecode-1.8.1.dev181512403}/braindecode/models/brainmodule.py
RENAMED
|
@@ -20,7 +20,6 @@ from torch.nn import functional as F
|
|
|
20
20
|
from braindecode.models.base import EEGModuleMixin
|
|
21
21
|
from braindecode.models.util import has_valid_locations, positions_from_chs_info
|
|
22
22
|
from braindecode.modules import ChannelMerger
|
|
23
|
-
from braindecode.modules.attention import _hpu_lazy
|
|
24
23
|
from braindecode.modules.layers import SubjectLayers
|
|
25
24
|
|
|
26
25
|
__all__ = ["BrainModule"]
|
|
@@ -713,7 +712,7 @@ class _ConvSequence(nn.Module):
|
|
|
713
712
|
nn.Conv1d(
|
|
714
713
|
chout, 2 * chout, 1 + 2 * glu_context, padding=glu_context
|
|
715
714
|
),
|
|
716
|
-
|
|
715
|
+
nn.GLU(dim=1),
|
|
717
716
|
)
|
|
718
717
|
)
|
|
719
718
|
else:
|
|
@@ -728,17 +727,6 @@ class _ConvSequence(nn.Module):
|
|
|
728
727
|
return x
|
|
729
728
|
|
|
730
729
|
|
|
731
|
-
class _GLU(nn.GLU):
|
|
732
|
-
"""``nn.GLU`` that Intel Gaudi's lazy mode can compile."""
|
|
733
|
-
|
|
734
|
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
735
|
-
if not torch.jit.is_scripting() and x.device.type == "hpu" and _hpu_lazy():
|
|
736
|
-
# Its graph compiler fails on ``aten.glu`` after a convolution.
|
|
737
|
-
a, b = x.chunk(2, dim=self.dim)
|
|
738
|
-
return a * torch.sigmoid(b)
|
|
739
|
-
return F.glu(x, self.dim)
|
|
740
|
-
|
|
741
|
-
|
|
742
730
|
def _pad_multiple(x: torch.Tensor, base: int) -> torch.Tensor:
|
|
743
731
|
"""Pad tensor to be a multiple of base."""
|
|
744
732
|
length = x.shape[-1]
|