Braindecode 1.3.2.dev182822510__tar.gz → 1.3.2.dev183330317__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.dev182822510/braindecode.egg-info → braindecode-1.3.2.dev183330317}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/base.py +1 -27
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/hub.py +73 -143
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/hub_io.py +4 -12
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/hub_formats.py +1 -8
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/windowers.py +2 -7
- braindecode-1.3.2.dev183330317/braindecode/version.py +1 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/visualization/gradients.py +7 -7
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/whats_new.rst +1 -9
- braindecode-1.3.2.dev182822510/braindecode/version.py +0 -1
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/LICENSE.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/MANIFEST.in +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/NOTICE.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/README.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/classifier.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/base.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/bendr.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/brainmodule.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/config.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegpt.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegsym.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/labram.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/luna.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/medformer.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/reve.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/summary.csv +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/tcn.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/util.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/attention.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/mne_preprocess.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/preprocess.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/regressor.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/util.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/SOURCES.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/Makefile +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/api.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/cite.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/conf.py +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/help.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/index.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/install/install.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/models.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/pyproject.toml +0 -0
- {braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/setup.cfg +0 -0
{braindecode-1.3.2.dev182822510/braindecode.egg-info → braindecode-1.3.2.dev183330317}/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.dev183330317
|
|
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.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/base.py
RENAMED
|
@@ -617,15 +617,6 @@ class WindowsDataset(RecordDataset):
|
|
|
617
617
|
last_target_only: bool = True,
|
|
618
618
|
):
|
|
619
619
|
super().__init__(description, transform)
|
|
620
|
-
self._fast_disk = self._can_use_fast_get_epoch_from_raw(windows)
|
|
621
|
-
if not (self._fast_disk or windows.preload):
|
|
622
|
-
warnings.warn(
|
|
623
|
-
"The provided mne.Epochs object does not meet the requirements for "
|
|
624
|
-
"fast epoch access. This may lead to slow data loading from disk. "
|
|
625
|
-
"Consider preloading the epochs or checking the conditions in "
|
|
626
|
-
"WindowsDataset._can_use_fast_get_epoch_from_raw.",
|
|
627
|
-
UserWarning,
|
|
628
|
-
)
|
|
629
620
|
self.windows = windows
|
|
630
621
|
self.last_target_only = last_target_only
|
|
631
622
|
if targets_from not in ("metadata", "channels"):
|
|
@@ -642,20 +633,6 @@ class WindowsDataset(RecordDataset):
|
|
|
642
633
|
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
643
634
|
self.window_preproc_kwargs: list[dict[str, Any]] = []
|
|
644
635
|
|
|
645
|
-
@staticmethod
|
|
646
|
-
def _can_use_fast_get_epoch_from_raw(epochs: mne.BaseEpochs) -> bool:
|
|
647
|
-
"""Check if we can use the fast _get_epoch_from_raw method,
|
|
648
|
-
or if we need to use the slow get_data method."""
|
|
649
|
-
return (
|
|
650
|
-
not epochs.preload
|
|
651
|
-
and epochs._bad_dropped
|
|
652
|
-
and epochs.detrend is None
|
|
653
|
-
and not epochs._do_baseline # baseline is None
|
|
654
|
-
and (epochs._decim == 1)
|
|
655
|
-
and epochs._offset is None
|
|
656
|
-
and epochs._projector is None
|
|
657
|
-
)
|
|
658
|
-
|
|
659
636
|
def __getitem__(self, index: int):
|
|
660
637
|
"""Get a window and its target.
|
|
661
638
|
|
|
@@ -673,10 +650,7 @@ class WindowsDataset(RecordDataset):
|
|
|
673
650
|
np.ndarray
|
|
674
651
|
Crop indices.
|
|
675
652
|
"""
|
|
676
|
-
|
|
677
|
-
X = self.windows._get_epoch_from_raw(index).astype("float32")
|
|
678
|
-
else:
|
|
679
|
-
X = self.windows.get_data(item=index)[0].astype("float32")
|
|
653
|
+
X = self.windows.get_data(item=index)[0].astype("float32")
|
|
680
654
|
if self.transform is not None:
|
|
681
655
|
X = self.transform(X)
|
|
682
656
|
if self.targets_from == "metadata":
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bids/hub.py
RENAMED
|
@@ -27,7 +27,6 @@ The format follows a BIDS-inspired sourcedata structure:
|
|
|
27
27
|
#
|
|
28
28
|
# License: BSD (3-clause)
|
|
29
29
|
|
|
30
|
-
import contextlib
|
|
31
30
|
import json
|
|
32
31
|
import logging
|
|
33
32
|
import tempfile
|
|
@@ -70,8 +69,6 @@ huggingface_hub = _soft_import(
|
|
|
70
69
|
|
|
71
70
|
log = logging.getLogger(__name__)
|
|
72
71
|
|
|
73
|
-
_LOCK_FILE = "format_info.json"
|
|
74
|
-
|
|
75
72
|
|
|
76
73
|
class HubDatasetMixin:
|
|
77
74
|
"""
|
|
@@ -87,6 +84,7 @@ class HubDatasetMixin:
|
|
|
87
84
|
>>> dataset = NMT(path=path, preload=True)
|
|
88
85
|
>>> dataset.push_to_hub(
|
|
89
86
|
... repo_id="username/nmt-dataset",
|
|
87
|
+
... commit_message="Add NMT dataset"
|
|
90
88
|
... )
|
|
91
89
|
>>>
|
|
92
90
|
>>> # Load dataset from Hub
|
|
@@ -98,14 +96,13 @@ class HubDatasetMixin:
|
|
|
98
96
|
def push_to_hub(
|
|
99
97
|
self,
|
|
100
98
|
repo_id: str,
|
|
99
|
+
commit_message: Optional[str] = None,
|
|
101
100
|
private: bool = False,
|
|
102
101
|
token: Optional[str] = None,
|
|
102
|
+
create_pr: bool = False,
|
|
103
103
|
compression: str = "blosc",
|
|
104
104
|
compression_level: int = 5,
|
|
105
105
|
pipeline_name: str = "braindecode",
|
|
106
|
-
chunk_size: int = 10000,
|
|
107
|
-
local_cache_dir: str | Path | None = None,
|
|
108
|
-
**kwargs,
|
|
109
106
|
) -> str:
|
|
110
107
|
"""
|
|
111
108
|
Upload the dataset to the Hugging Face Hub in BIDS-like Zarr format.
|
|
@@ -119,38 +116,20 @@ class HubDatasetMixin:
|
|
|
119
116
|
----------
|
|
120
117
|
repo_id : str
|
|
121
118
|
Repository ID on the Hugging Face Hub (e.g., "username/dataset-name").
|
|
119
|
+
commit_message : str | None
|
|
120
|
+
Commit message. If None, a default message is generated.
|
|
122
121
|
private : bool, default=False
|
|
123
122
|
Whether to create a private repository.
|
|
124
123
|
token : str | None
|
|
125
124
|
Hugging Face API token. If None, uses cached token.
|
|
125
|
+
create_pr : bool, default=False
|
|
126
|
+
Whether to create a Pull Request instead of directly committing.
|
|
126
127
|
compression : str, default="blosc"
|
|
127
128
|
Compression algorithm for Zarr. Options: "blosc", "zstd", "gzip", None.
|
|
128
129
|
compression_level : int, default=5
|
|
129
130
|
Compression level (0-9). Level 5 provides optimal balance.
|
|
130
131
|
pipeline_name : str, default="braindecode"
|
|
131
132
|
Name of the processing pipeline for BIDS sourcedata.
|
|
132
|
-
chunk_size : int, default=10000
|
|
133
|
-
Number of samples per chunk in Zarr. Larger chunk size will create fewer
|
|
134
|
-
but larger files. Only used for RawDataset and EEGWindowsDataset (continuous data).
|
|
135
|
-
With WindowsDataset (pre-cut epochs), each window is saved as a separate chunk.
|
|
136
|
-
local_cache_dir : str | Path | None
|
|
137
|
-
Local directory to use for temporary files during upload. If None, uses
|
|
138
|
-
the system temp directory and cleans it up after upload. If provided,
|
|
139
|
-
the directory is used as a persistent cache:
|
|
140
|
-
|
|
141
|
-
- If the directory is empty (or does not exist), the cache is built
|
|
142
|
-
there and a lock file (``format_info.json``) is written once
|
|
143
|
-
the cache is complete, before the upload starts. The file
|
|
144
|
-
contains the zarr conversion parameters as JSON.
|
|
145
|
-
- If the lock file is present and its JSON parameters match the
|
|
146
|
-
current call, cache creation is skipped and the upload resumes
|
|
147
|
-
directly (useful for retrying interrupted uploads).
|
|
148
|
-
- If the lock file is present but its JSON parameters differ from
|
|
149
|
-
the current call, a ``ValueError`` is raised.
|
|
150
|
-
- If the directory is non-empty but the lock file is absent, a
|
|
151
|
-
``ValueError`` is raised listing the files found.
|
|
152
|
-
**kwargs
|
|
153
|
-
Additional arguments passed to huggingface_hub.upload_large_folder().
|
|
154
133
|
|
|
155
134
|
Returns
|
|
156
135
|
-------
|
|
@@ -170,6 +149,7 @@ class HubDatasetMixin:
|
|
|
170
149
|
>>> # Upload with BIDS-like structure
|
|
171
150
|
>>> url = dataset.push_to_hub(
|
|
172
151
|
... repo_id="myusername/nmt-dataset",
|
|
152
|
+
... commit_message="Upload NMT EEG dataset"
|
|
173
153
|
... )
|
|
174
154
|
"""
|
|
175
155
|
if huggingface_hub is False or zarr is False:
|
|
@@ -179,12 +159,13 @@ class HubDatasetMixin:
|
|
|
179
159
|
)
|
|
180
160
|
|
|
181
161
|
# Create API instance
|
|
182
|
-
|
|
162
|
+
_ = huggingface_hub.HfApi(token=token)
|
|
183
163
|
|
|
184
164
|
# Create repository if it doesn't exist
|
|
185
165
|
try:
|
|
186
|
-
|
|
166
|
+
huggingface_hub.create_repo(
|
|
187
167
|
repo_id=repo_id,
|
|
168
|
+
token=token,
|
|
188
169
|
private=private,
|
|
189
170
|
repo_type="dataset",
|
|
190
171
|
exist_ok=True,
|
|
@@ -192,68 +173,74 @@ class HubDatasetMixin:
|
|
|
192
173
|
except Exception as e:
|
|
193
174
|
raise RuntimeError(f"Failed to create repository: {e}")
|
|
194
175
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"pipeline_name": pipeline_name,
|
|
199
|
-
"compression": compression,
|
|
200
|
-
"compression_level": compression_level,
|
|
201
|
-
"chunk_size": chunk_size,
|
|
202
|
-
"braindecode_version": braindecode.__version__,
|
|
203
|
-
**format_info,
|
|
204
|
-
}
|
|
176
|
+
# Create a temporary directory for upload
|
|
177
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
178
|
+
tmp_path = Path(tmpdir)
|
|
205
179
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
180
|
+
# Create BIDS-like sourcedata structure
|
|
181
|
+
log.info("Creating BIDS-like sourcedata structure...")
|
|
182
|
+
bids_layout = hub_format.BIDSSourcedataLayout(
|
|
183
|
+
tmp_path, pipeline_name=pipeline_name
|
|
184
|
+
)
|
|
185
|
+
sourcedata_dir = bids_layout.create_structure()
|
|
186
|
+
|
|
187
|
+
# Save dataset_description.json
|
|
188
|
+
bids_layout.save_dataset_description()
|
|
189
|
+
|
|
190
|
+
# Save participants.tsv
|
|
191
|
+
descriptions = [ds.description for ds in self.datasets]
|
|
192
|
+
bids_layout.save_participants(descriptions)
|
|
193
|
+
|
|
194
|
+
# Save BIDS sidecar files for each recording
|
|
195
|
+
self._save_bids_sidecar_files(bids_layout)
|
|
196
|
+
|
|
197
|
+
# Convert dataset to Zarr format inside sourcedata
|
|
198
|
+
log.info("Converting dataset to Zarr format...")
|
|
199
|
+
dataset_path = sourcedata_dir / "dataset.zarr"
|
|
200
|
+
|
|
201
|
+
self._convert_to_zarr_inline(
|
|
202
|
+
dataset_path,
|
|
203
|
+
compression,
|
|
204
|
+
compression_level,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
# Save dataset metadata (README.md)
|
|
208
|
+
self._save_dataset_card(tmp_path)
|
|
209
|
+
|
|
210
|
+
# Save format info
|
|
211
|
+
format_info_path = tmp_path / "format_info.json"
|
|
212
|
+
with open(format_info_path, "w", encoding="utf-8") as f:
|
|
213
|
+
format_info = self._get_format_info_inline()
|
|
214
|
+
json.dump(
|
|
215
|
+
{
|
|
216
|
+
"format": "zarr",
|
|
217
|
+
"pipeline_name": pipeline_name,
|
|
218
|
+
"compression": compression,
|
|
219
|
+
"compression_level": compression_level,
|
|
220
|
+
"braindecode_version": braindecode.__version__,
|
|
221
|
+
**format_info,
|
|
222
|
+
},
|
|
223
|
+
f,
|
|
224
|
+
indent=2,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
# Default commit message
|
|
228
|
+
if commit_message is None:
|
|
229
|
+
commit_message = (
|
|
230
|
+
f"Upload EEG dataset in BIDS-like "
|
|
231
|
+
f"Zarr format ({len(self.datasets)} recordings)"
|
|
232
|
+
)
|
|
248
233
|
|
|
249
234
|
# Upload folder to Hub
|
|
250
235
|
log.info(f"Uploading to Hugging Face Hub ({repo_id})...")
|
|
251
236
|
try:
|
|
252
|
-
url =
|
|
237
|
+
url = huggingface_hub.upload_folder(
|
|
253
238
|
repo_id=repo_id,
|
|
254
239
|
folder_path=str(tmp_path),
|
|
255
240
|
repo_type="dataset",
|
|
256
|
-
|
|
241
|
+
commit_message=commit_message,
|
|
242
|
+
token=token,
|
|
243
|
+
create_pr=create_pr,
|
|
257
244
|
)
|
|
258
245
|
log.info(f"Dataset uploaded successfully to {repo_id}")
|
|
259
246
|
log.info(f"URL: https://huggingface.co/datasets/{repo_id}")
|
|
@@ -261,55 +248,6 @@ class HubDatasetMixin:
|
|
|
261
248
|
except Exception as e:
|
|
262
249
|
raise RuntimeError(f"Failed to upload dataset: {e}")
|
|
263
250
|
|
|
264
|
-
def _build_local_cache(
|
|
265
|
-
self,
|
|
266
|
-
tmp_path,
|
|
267
|
-
format_info_lock,
|
|
268
|
-
):
|
|
269
|
-
"""Build the local cache directory with the dataset in Zarr format and BIDS-like structure.
|
|
270
|
-
This folder will be uploaded to the Hub"""
|
|
271
|
-
compression = format_info_lock["compression"]
|
|
272
|
-
compression_level = format_info_lock["compression_level"]
|
|
273
|
-
pipeline_name = format_info_lock["pipeline_name"]
|
|
274
|
-
chunk_size = format_info_lock["chunk_size"]
|
|
275
|
-
|
|
276
|
-
# Create BIDS-like sourcedata structure
|
|
277
|
-
log.info("Creating BIDS-like sourcedata structure...")
|
|
278
|
-
bids_layout = hub_format.BIDSSourcedataLayout(
|
|
279
|
-
tmp_path, pipeline_name=pipeline_name
|
|
280
|
-
)
|
|
281
|
-
sourcedata_dir = bids_layout.create_structure()
|
|
282
|
-
|
|
283
|
-
# Save dataset_description.json
|
|
284
|
-
bids_layout.save_dataset_description()
|
|
285
|
-
|
|
286
|
-
# Save participants.tsv
|
|
287
|
-
descriptions = [ds.description for ds in self.datasets]
|
|
288
|
-
bids_layout.save_participants(descriptions)
|
|
289
|
-
|
|
290
|
-
# Save BIDS sidecar files for each recording
|
|
291
|
-
self._save_bids_sidecar_files(bids_layout)
|
|
292
|
-
|
|
293
|
-
# Convert dataset to Zarr format inside sourcedata
|
|
294
|
-
log.info("Converting dataset to Zarr format...")
|
|
295
|
-
dataset_path = sourcedata_dir / "dataset.zarr"
|
|
296
|
-
|
|
297
|
-
self._convert_to_zarr_inline(
|
|
298
|
-
dataset_path,
|
|
299
|
-
compression,
|
|
300
|
-
compression_level,
|
|
301
|
-
chunk_size,
|
|
302
|
-
)
|
|
303
|
-
|
|
304
|
-
# Save dataset metadata (README.md)
|
|
305
|
-
self._save_dataset_card(tmp_path)
|
|
306
|
-
|
|
307
|
-
# Save format info
|
|
308
|
-
# This marks the cache as complete
|
|
309
|
-
format_info_path = tmp_path / _LOCK_FILE
|
|
310
|
-
with open(format_info_path, "w", encoding="utf-8") as f:
|
|
311
|
-
json.dump(format_info_lock, f, indent=2)
|
|
312
|
-
|
|
313
251
|
def _save_dataset_card(self, path: Path, bids_inspired: bool = True) -> None:
|
|
314
252
|
"""Generate and save a dataset card (README.md) with metadata.
|
|
315
253
|
|
|
@@ -527,7 +465,7 @@ class HubDatasetMixin:
|
|
|
527
465
|
)
|
|
528
466
|
|
|
529
467
|
# Load format info
|
|
530
|
-
format_info_path = Path(dataset_dir) /
|
|
468
|
+
format_info_path = Path(dataset_dir) / "format_info.json"
|
|
531
469
|
if format_info_path.exists():
|
|
532
470
|
with open(format_info_path, "r") as f:
|
|
533
471
|
format_info = json.load(f)
|
|
@@ -657,7 +595,6 @@ class HubDatasetMixin:
|
|
|
657
595
|
output_path: Path,
|
|
658
596
|
compression: str,
|
|
659
597
|
compression_level: int,
|
|
660
|
-
chunk_size: int = 10000,
|
|
661
598
|
) -> None:
|
|
662
599
|
"""Convert dataset to Zarr format (inline implementation)."""
|
|
663
600
|
|
|
@@ -745,7 +682,6 @@ class HubDatasetMixin:
|
|
|
745
682
|
targets_from,
|
|
746
683
|
last_target_only,
|
|
747
684
|
compressor,
|
|
748
|
-
chunk_size,
|
|
749
685
|
)
|
|
750
686
|
|
|
751
687
|
elif dataset_type == "RawDataset":
|
|
@@ -757,13 +693,7 @@ class HubDatasetMixin:
|
|
|
757
693
|
|
|
758
694
|
# Save using inlined function
|
|
759
695
|
_save_raw_to_zarr(
|
|
760
|
-
grp,
|
|
761
|
-
raw,
|
|
762
|
-
description,
|
|
763
|
-
info_dict,
|
|
764
|
-
target_name,
|
|
765
|
-
compressor,
|
|
766
|
-
chunk_size,
|
|
696
|
+
grp, raw, description, info_dict, target_name, compressor
|
|
767
697
|
)
|
|
768
698
|
|
|
769
699
|
def _get_format_info_inline(self):
|
|
@@ -70,15 +70,7 @@ def _save_windows_to_zarr(
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def _save_eegwindows_to_zarr(
|
|
73
|
-
grp,
|
|
74
|
-
raw,
|
|
75
|
-
metadata,
|
|
76
|
-
description,
|
|
77
|
-
info,
|
|
78
|
-
targets_from,
|
|
79
|
-
last_target_only,
|
|
80
|
-
compressor,
|
|
81
|
-
chunk_size,
|
|
73
|
+
grp, raw, metadata, description, info, targets_from, last_target_only, compressor
|
|
82
74
|
):
|
|
83
75
|
"""Save EEG continuous raw data to Zarr group (low-level function)."""
|
|
84
76
|
continuous_data = raw.get_data()
|
|
@@ -88,7 +80,7 @@ def _save_eegwindows_to_zarr(
|
|
|
88
80
|
grp.create_array(
|
|
89
81
|
"data",
|
|
90
82
|
data=continuous_float,
|
|
91
|
-
chunks=(continuous_float.shape[0], min(
|
|
83
|
+
chunks=(continuous_float.shape[0], min(10000, continuous_float.shape[1])),
|
|
92
84
|
compressors=compressors_list,
|
|
93
85
|
)
|
|
94
86
|
|
|
@@ -151,7 +143,7 @@ def _load_eegwindows_from_zarr(grp, preload):
|
|
|
151
143
|
return data, metadata, description, info_dict, targets_from, last_target_only
|
|
152
144
|
|
|
153
145
|
|
|
154
|
-
def _save_raw_to_zarr(grp, raw, description, info, target_name, compressor
|
|
146
|
+
def _save_raw_to_zarr(grp, raw, description, info, target_name, compressor):
|
|
155
147
|
"""Save RawDataset continuous raw data to Zarr group (low-level function)."""
|
|
156
148
|
continuous_data = raw.get_data()
|
|
157
149
|
continuous_float = continuous_data.astype(np.float32)
|
|
@@ -160,7 +152,7 @@ def _save_raw_to_zarr(grp, raw, description, info, target_name, compressor, chun
|
|
|
160
152
|
grp.create_array(
|
|
161
153
|
"data",
|
|
162
154
|
data=continuous_float,
|
|
163
|
-
chunks=(continuous_float.shape[0], min(
|
|
155
|
+
chunks=(continuous_float.shape[0], min(10000, continuous_float.shape[1])),
|
|
164
156
|
compressors=compressors_list,
|
|
165
157
|
)
|
|
166
158
|
|
|
@@ -36,7 +36,6 @@ def convert_to_zarr(
|
|
|
36
36
|
output_path: Union[str, Path],
|
|
37
37
|
compression: str = "blosc",
|
|
38
38
|
compression_level: int = 5,
|
|
39
|
-
chunk_size: int = 10000,
|
|
40
39
|
overwrite: bool = False,
|
|
41
40
|
) -> Path:
|
|
42
41
|
"""Convert BaseConcatDataset to Zarr format.
|
|
@@ -59,10 +58,6 @@ def convert_to_zarr(
|
|
|
59
58
|
blosc uses zstd codec by default, providing best balance of speed and compression.
|
|
60
59
|
compression_level : int, default=5
|
|
61
60
|
Compression level (0-9). Level 5 provides optimal balance based on benchmarks.
|
|
62
|
-
chunk_size : int, default=10000
|
|
63
|
-
Number of samples per chunk in Zarr. Larger chunk size will create fewer
|
|
64
|
-
but larger files. Only used for RawDataset and EEGWindowsDataset (continuous data).
|
|
65
|
-
With WindowsDataset (pre-cut epochs), each window is saved as a separate chunk.
|
|
66
61
|
overwrite : bool, default=False
|
|
67
62
|
Whether to overwrite existing directory.
|
|
68
63
|
|
|
@@ -101,9 +96,7 @@ def convert_to_zarr(
|
|
|
101
96
|
shutil.rmtree(output_path)
|
|
102
97
|
|
|
103
98
|
# Delegate to HubDatasetMixin method
|
|
104
|
-
dataset._convert_to_zarr_inline(
|
|
105
|
-
output_path, compression, compression_level, chunk_size
|
|
106
|
-
)
|
|
99
|
+
dataset._convert_to_zarr_inline(output_path, compression, compression_level)
|
|
107
100
|
|
|
108
101
|
return output_path
|
|
109
102
|
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
# Mohammed Fattouh <mo.fattouh@gmail.com>
|
|
13
13
|
# Robin Schirrmeister <robintibor@gmail.com>
|
|
14
14
|
# Matthew Chen <matt.chen42601@gmail.com>
|
|
15
|
-
# Sarthak Tayal <sarthaktayal2@gmail.com>
|
|
16
15
|
#
|
|
17
16
|
# License: BSD (3-clause)
|
|
18
17
|
|
|
@@ -1046,12 +1045,8 @@ def _create_windows_from_target_channels(
|
|
|
1046
1045
|
stop = ds.raw.n_times + ds.raw.first_samp
|
|
1047
1046
|
|
|
1048
1047
|
target = ds.raw.get_data(picks="misc")
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
# when multiple target channels exist, some may have values at timepoints
|
|
1052
|
-
# where others are nan. using any() across channels catches all of them.
|
|
1053
|
-
has_target = np.any(~np.isnan(target), axis=0)
|
|
1054
|
-
stops = np.nonzero(has_target)[0] + 1
|
|
1048
|
+
# TODO: handle multi targets present only for some events
|
|
1049
|
+
stops = np.nonzero((~np.isnan(target[0, :])))[0] + 1
|
|
1055
1050
|
stops = stops[(stops < stop) & (stops >= window_size_samples)]
|
|
1056
1051
|
stops = stops.astype(int)
|
|
1057
1052
|
metadata = pd.DataFrame(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.3.2.dev183330317"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# Authors: Robin Schirrmeister <robintibor@gmail.com>
|
|
2
|
-
# Sarthak Tayal <sarthaktayal2@gmail.com>
|
|
3
2
|
#
|
|
4
3
|
# License: BSD (3-clause)
|
|
5
4
|
|
|
@@ -36,17 +35,18 @@ def compute_amplitude_gradients_for_X(model, X):
|
|
|
36
35
|
amps_th = to_tensor(amps.astype(np.float32), device=device).requires_grad_(True)
|
|
37
36
|
phases_th = to_tensor(phases.astype(np.float32), device=device).requires_grad_(True)
|
|
38
37
|
|
|
39
|
-
# rebuild fft coefficients from amplitude and phase as real valued pairs,
|
|
40
|
-
# convert to complex, and invert back to the time domain.
|
|
41
|
-
# torch.irfft was removed after being deprecated since pytorch 1.7,
|
|
42
|
-
# so we use torch.fft.irfft which expects complex input directly.
|
|
43
38
|
fft_coefs = amps_th.unsqueeze(-1) * torch.stack(
|
|
44
39
|
(torch.cos(phases_th), torch.sin(phases_th)), dim=-1
|
|
45
40
|
)
|
|
46
41
|
fft_coefs = fft_coefs.squeeze(3)
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
try:
|
|
44
|
+
complex_fft_coefs = torch.view_as_complex(fft_coefs)
|
|
45
|
+
iffted = torch.fft.irfft(complex_fft_coefs, n=X.shape[2], dim=2)
|
|
46
|
+
except AttributeError:
|
|
47
|
+
iffted = torch.irfft( # Deprecated since 1.7
|
|
48
|
+
fft_coefs, signal_ndim=1, signal_sizes=(X.shape[2],)
|
|
49
|
+
)
|
|
50
50
|
|
|
51
51
|
outs = model(iffted)
|
|
52
52
|
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317/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.dev183330317
|
|
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>
|
|
@@ -54,7 +54,6 @@ Enhancements
|
|
|
54
54
|
(:gh:`941` by `Aman Srivastava`_).
|
|
55
55
|
- Per-event-type windowing parameters in :func:`braindecode.preprocessing.windowers.create_windows_from_events` (:gh:`942` by `Pierre Guetschel`_)
|
|
56
56
|
- Add ``use_mne_epochs`` support to :func:`braindecode.preprocessing.windowers.create_fixed_length_windows` (:gh:`943` by `Pierre Guetschel`_)
|
|
57
|
-
- Faster loading from epochs on disk with :class:`braindecode.datasets.base.WindowsDataset` (:gh:`944` by `Pierre Guetschel`_)
|
|
58
57
|
|
|
59
58
|
API changes
|
|
60
59
|
============
|
|
@@ -66,9 +65,6 @@ Requirements
|
|
|
66
65
|
|
|
67
66
|
Bugs
|
|
68
67
|
=====
|
|
69
|
-
- Fix multi-target channel windowing in :func:`braindecode.preprocessing.windowers.create_windows_from_target_channels`
|
|
70
|
-
to use the union of valid target positions across all misc channels instead of only the first channel
|
|
71
|
-
(by `Sarthak Tayal`_)
|
|
72
68
|
- Fix :func:`braindecode.preprocessing.preprocess.filterbank` to preserve info fields
|
|
73
69
|
(``description``, ``line_freq``, ``device_info``, etc.) when creating filtered copies,
|
|
74
70
|
avoiding merge conflicts in MNE when adding channels (:gh:`928` by `Bruno Aristimunha`_)
|
|
@@ -77,13 +73,10 @@ Bugs
|
|
|
77
73
|
- Fix Zenodo citation: update to global concept DOI and add BibTeX/APA citation formats
|
|
78
74
|
in ``docs/cite.rst``, ``README.rst``, ``CITATION.cff``, and ``docs/conf.py``
|
|
79
75
|
(:gh:`937` by `Bruno Aristimunha`_)
|
|
80
|
-
- Push large datasets to HuggingFace Hub using :func:`huggingface_hub.upload_large_folder` to avoid limitations, and allow resuming downloads (:gh:`945` by `Pierre Guetschel`_)
|
|
81
76
|
|
|
82
77
|
Code health
|
|
83
78
|
============
|
|
84
|
-
-
|
|
85
|
-
now uses ``torch.fft.irfft`` directly since braindecode requires ``torch>=2.2``
|
|
86
|
-
(by `Sarthak Tayal`_)
|
|
79
|
+
- None yet.
|
|
87
80
|
|
|
88
81
|
|
|
89
82
|
Current 1.3.2 (stable)
|
|
@@ -831,4 +824,3 @@ Authors
|
|
|
831
824
|
.. _Aniela Bulicz: https://github.com/AryaDro
|
|
832
825
|
.. _Mattew Chew: https://github.com/MatthewChen37
|
|
833
826
|
.. _Aman Srivastava: https://github.com/aman-coder03
|
|
834
|
-
.. _Sarthak Tayal: https://github.com/tayal-sarthak
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.3.2.dev182822510"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/augmentation/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bbci.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/bcicomp.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/chb_mit.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/mne.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/moabb.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/nmt.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/registry.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/siena.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/tuh.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/utils.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datasets/xy.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/datautil/util.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/eegneuralnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/functional/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/atcnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/attn_sleep.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/base.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/bendr.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/biot.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/brainmodule.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/cbramod.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/config.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/contrawr.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/ctnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/deep4.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/deepsleepnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegconformer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegitnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegminer.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegnex.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegpt.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegsym.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/eegtcnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/fbcnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/fbmsnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/hybrid.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/ifnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/labram.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/luna.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/medformer.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/msvtnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/reve.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sccnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/signal_jepa.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sinc_shallow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sparcnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/sstdpn.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/summary.csv
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/syncnet.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/tidnet.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/tsinception.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/usleep.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/models/util.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/activation.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/attention.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/blocks.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/convolution.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/filter.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/layers.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/linear.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/stats.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/util.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/modules/wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/preprocessing/util.py
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/base.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/samplers/ssl.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/__init__.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/callbacks.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/losses.py
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode/training/scoring.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/requires.txt
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/braindecode.egg-info/top_level.txt
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
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/install/install_pip.rst
RENAMED
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/install/install_source.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/gnn.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/lbm.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/categorization/spd.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/models/models_table.rst
RENAMED
|
File without changes
|
|
File without changes
|
{braindecode-1.3.2.dev182822510 → braindecode-1.3.2.dev183330317}/docs/sg_execution_times.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|