Braindecode 1.3.2.dev179216654__tar.gz → 1.3.2.dev179324568__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.dev179216654/braindecode.egg-info → braindecode-1.3.2.dev179324568}/PKG-INFO +2 -3
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/base.py +0 -396
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegpt.py +19 -190
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/labram.py +77 -327
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/util.py +1 -1
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/__init__.py +0 -2
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/convolution.py +0 -20
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/preprocess.py +0 -17
- braindecode-1.3.2.dev179324568/braindecode/version.py +1 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568/braindecode.egg-info}/PKG-INFO +2 -3
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode.egg-info/requires.txt +1 -2
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/whats_new.rst +2 -15
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/pyproject.toml +3 -7
- braindecode-1.3.2.dev179216654/braindecode/version.py +0 -1
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/LICENSE.txt +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/MANIFEST.in +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/NOTICE.txt +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/README.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/classifier.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/datasets.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/format.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/hub.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/hub_format.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/hub_io.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/hub_validation.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/bids/iterable.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/chb_mit.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/registry.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/siena.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/utils.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datautil/hub_formats.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datautil/serialization.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/base.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/bendr.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/brainmodule.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/cbramod.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/config.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegsym.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/luna.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/medformer.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/reve.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/summary.csv +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/tcn.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/attention.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/mne_preprocess.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/util.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/regressor.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/util.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode.egg-info/SOURCES.txt +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/Makefile +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/api.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/cite.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/conf.py +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/help.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/index.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/install/install.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/models.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/setup.cfg +0 -0
{braindecode-1.3.2.dev179216654/braindecode.egg-info → braindecode-1.3.2.dev179324568}/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.dev179324568
|
|
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>
|
|
@@ -25,7 +25,6 @@ License-File: NOTICE.txt
|
|
|
25
25
|
Requires-Dist: torch>=2.2
|
|
26
26
|
Requires-Dist: torchaudio>=2.0
|
|
27
27
|
Requires-Dist: mne>=1.11.0
|
|
28
|
-
Requires-Dist: pandas<3.0.0
|
|
29
28
|
Requires-Dist: mne_bids>=0.18
|
|
30
29
|
Requires-Dist: h5py
|
|
31
30
|
Requires-Dist: skorch>=1.3.0
|
|
@@ -52,7 +51,7 @@ Requires-Dist: mypy; extra == "tests"
|
|
|
52
51
|
Requires-Dist: transformers>=4.57.0; extra == "tests"
|
|
53
52
|
Requires-Dist: bids_validator; extra == "tests"
|
|
54
53
|
Provides-Extra: typing
|
|
55
|
-
Requires-Dist: exca
|
|
54
|
+
Requires-Dist: exca==0.4; extra == "typing"
|
|
56
55
|
Requires-Dist: numpydantic>=1.7; extra == "typing"
|
|
57
56
|
Provides-Extra: docs
|
|
58
57
|
Requires-Dist: sphinx_gallery; extra == "docs"
|
{braindecode-1.3.2.dev179216654 → braindecode-1.3.2.dev179324568}/braindecode/datasets/base.py
RENAMED
|
@@ -11,13 +11,11 @@
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
13
|
import bisect
|
|
14
|
-
import html as _html
|
|
15
14
|
import json
|
|
16
15
|
import os
|
|
17
16
|
import shutil
|
|
18
17
|
import warnings
|
|
19
18
|
from abc import abstractmethod
|
|
20
|
-
from collections import Counter
|
|
21
19
|
from collections.abc import Callable
|
|
22
20
|
from glob import glob
|
|
23
21
|
from typing import Any, Generic, Iterable, no_type_check
|
|
@@ -44,256 +42,6 @@ def _create_description(description) -> pd.Series:
|
|
|
44
42
|
return description
|
|
45
43
|
|
|
46
44
|
|
|
47
|
-
def _html_row(label, value):
|
|
48
|
-
"""Generate a single HTML table row."""
|
|
49
|
-
label = _html.escape(str(label))
|
|
50
|
-
value = _html.escape(str(value))
|
|
51
|
-
return f"<tr><td><b>{label}</b></td><td>{value}</td></tr>"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_METADATA_INTERNAL_COLS = {
|
|
55
|
-
"i_window_in_trial",
|
|
56
|
-
"i_start_in_trial",
|
|
57
|
-
"i_stop_in_trial",
|
|
58
|
-
"target",
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def _metadata_summary(metadata):
|
|
63
|
-
"""Summarize window metadata into a dict.
|
|
64
|
-
|
|
65
|
-
Returns a dict with keys: n_windows, target_info, extra_columns,
|
|
66
|
-
window_info, is_lazy.
|
|
67
|
-
"""
|
|
68
|
-
is_lazy = not isinstance(metadata, pd.DataFrame)
|
|
69
|
-
|
|
70
|
-
if is_lazy:
|
|
71
|
-
n_windows = len(metadata)
|
|
72
|
-
columns = list(metadata.columns) if hasattr(metadata, "columns") else []
|
|
73
|
-
extra_columns = [str(c) for c in columns if c not in _METADATA_INTERNAL_COLS]
|
|
74
|
-
return {
|
|
75
|
-
"n_windows": n_windows,
|
|
76
|
-
"target_info": None,
|
|
77
|
-
"extra_columns": extra_columns,
|
|
78
|
-
"window_info": None,
|
|
79
|
-
"is_lazy": True,
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
n_windows = len(metadata)
|
|
83
|
-
extra_columns = [
|
|
84
|
-
str(c) for c in metadata.columns if c not in _METADATA_INTERNAL_COLS
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
target_info = None
|
|
88
|
-
if "target" in metadata.columns:
|
|
89
|
-
targets = metadata["target"]
|
|
90
|
-
n_unique = targets.nunique()
|
|
91
|
-
if n_unique <= 10:
|
|
92
|
-
counts = targets.value_counts().sort_index().to_dict()
|
|
93
|
-
target_info = f"{n_unique} unique ({counts})"
|
|
94
|
-
else:
|
|
95
|
-
target_info = f"{n_unique} unique targets"
|
|
96
|
-
|
|
97
|
-
window_info = None
|
|
98
|
-
if "i_start_in_trial" in metadata.columns and "i_stop_in_trial" in metadata.columns:
|
|
99
|
-
sizes = metadata["i_stop_in_trial"] - metadata["i_start_in_trial"]
|
|
100
|
-
if len(sizes) == 0:
|
|
101
|
-
pass
|
|
102
|
-
elif (min_s := int(sizes.min())) == (max_s := int(sizes.max())):
|
|
103
|
-
window_info = {"min": min_s, "max": max_s, "uniform": True}
|
|
104
|
-
else:
|
|
105
|
-
window_info = {"min": min_s, "max": max_s, "uniform": False}
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
"n_windows": n_windows,
|
|
109
|
-
"target_info": target_info,
|
|
110
|
-
"extra_columns": extra_columns,
|
|
111
|
-
"window_info": window_info,
|
|
112
|
-
"is_lazy": False,
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def _concat_metadata_summary(datasets):
|
|
117
|
-
"""Aggregate metadata summary across datasets without full concatenation.
|
|
118
|
-
|
|
119
|
-
Returns a dict with keys: window_info, target_info, extra_columns.
|
|
120
|
-
"""
|
|
121
|
-
overall_min = None
|
|
122
|
-
overall_max = None
|
|
123
|
-
target_counts = Counter()
|
|
124
|
-
extra_cols = set()
|
|
125
|
-
|
|
126
|
-
for ds in datasets:
|
|
127
|
-
if hasattr(ds, "windows"):
|
|
128
|
-
md = ds.windows.metadata
|
|
129
|
-
elif hasattr(ds, "metadata"):
|
|
130
|
-
md = ds.metadata
|
|
131
|
-
else:
|
|
132
|
-
continue
|
|
133
|
-
if md is None or len(md) == 0:
|
|
134
|
-
continue
|
|
135
|
-
|
|
136
|
-
extra_cols.update(
|
|
137
|
-
str(c) for c in md.columns if c not in _METADATA_INTERNAL_COLS
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
if "i_start_in_trial" in md.columns and "i_stop_in_trial" in md.columns:
|
|
141
|
-
sizes = md["i_stop_in_trial"] - md["i_start_in_trial"]
|
|
142
|
-
if len(sizes) > 0:
|
|
143
|
-
ds_min, ds_max = int(sizes.min()), int(sizes.max())
|
|
144
|
-
overall_min = (
|
|
145
|
-
ds_min if overall_min is None else min(overall_min, ds_min)
|
|
146
|
-
)
|
|
147
|
-
overall_max = (
|
|
148
|
-
ds_max if overall_max is None else max(overall_max, ds_max)
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
if "target" in md.columns:
|
|
152
|
-
target_counts.update(md["target"].value_counts().to_dict())
|
|
153
|
-
|
|
154
|
-
window_info = None
|
|
155
|
-
if overall_min is not None:
|
|
156
|
-
window_info = {
|
|
157
|
-
"min": overall_min,
|
|
158
|
-
"max": overall_max,
|
|
159
|
-
"uniform": overall_min == overall_max,
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
target_info = None
|
|
163
|
-
if target_counts:
|
|
164
|
-
n_unique = len(target_counts)
|
|
165
|
-
if n_unique <= 10:
|
|
166
|
-
sorted_counts = dict(sorted(target_counts.items()))
|
|
167
|
-
target_info = f"{n_unique} unique ({sorted_counts})"
|
|
168
|
-
else:
|
|
169
|
-
target_info = f"{n_unique} unique targets"
|
|
170
|
-
|
|
171
|
-
return {
|
|
172
|
-
"window_info": window_info,
|
|
173
|
-
"target_info": target_info,
|
|
174
|
-
"extra_columns": sorted(extra_cols),
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
def _channel_info(mne_obj):
|
|
179
|
-
"""Extract channel summary from an mne object.
|
|
180
|
-
|
|
181
|
-
Returns (n_ch, type_str, sfreq).
|
|
182
|
-
"""
|
|
183
|
-
info = mne_obj.info
|
|
184
|
-
n_ch = info["nchan"]
|
|
185
|
-
sfreq = info["sfreq"]
|
|
186
|
-
ch_types = mne_obj.get_channel_types()
|
|
187
|
-
type_counts = Counter(ch_types)
|
|
188
|
-
type_str = ", ".join(f"{cnt} {t.upper()}" for t, cnt in sorted(type_counts.items()))
|
|
189
|
-
return n_ch, type_str, sfreq
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def _window_info(crop_inds, sfreq):
|
|
193
|
-
"""Extract window size from crop indices.
|
|
194
|
-
|
|
195
|
-
Returns (win_samples, win_secs) or None if crop_inds is empty.
|
|
196
|
-
"""
|
|
197
|
-
if len(crop_inds) == 0:
|
|
198
|
-
return None
|
|
199
|
-
first = crop_inds[0]
|
|
200
|
-
win_samples = int(first[2] - first[1])
|
|
201
|
-
win_secs = win_samples / sfreq
|
|
202
|
-
return win_samples, win_secs
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
class _ReprBuilder:
|
|
206
|
-
"""Lightweight builder that renders both text and HTML from the same data."""
|
|
207
|
-
|
|
208
|
-
def __init__(self, cls_name, type_display=None):
|
|
209
|
-
self._cls_name = cls_name
|
|
210
|
-
self._type_display = type_display or cls_name
|
|
211
|
-
self._header_parts = []
|
|
212
|
-
self._header_rows = []
|
|
213
|
-
self._items = []
|
|
214
|
-
|
|
215
|
-
def add_header(self, header_text, label, value):
|
|
216
|
-
"""Add to both the compact ``<ClassName | ...>`` line and an HTML row."""
|
|
217
|
-
self._header_parts.append(header_text)
|
|
218
|
-
self._header_rows.append((label, value))
|
|
219
|
-
return self
|
|
220
|
-
|
|
221
|
-
def add_row(self, label, value):
|
|
222
|
-
"""Add a detail row (text: `` label: value``, HTML: ``<tr>``)."""
|
|
223
|
-
self._items.append(("row", label, value))
|
|
224
|
-
return self
|
|
225
|
-
|
|
226
|
-
def add_footnote(self, text):
|
|
227
|
-
"""Add a footnote (text: `` (text)``, HTML: italic ``<td colspan=2>``)."""
|
|
228
|
-
self._items.append(("footnote", text, None))
|
|
229
|
-
return self
|
|
230
|
-
|
|
231
|
-
def to_repr(self):
|
|
232
|
-
if self._header_parts:
|
|
233
|
-
parts = " | ".join(self._header_parts)
|
|
234
|
-
lines = [f"<{self._cls_name} | {parts}>"]
|
|
235
|
-
else:
|
|
236
|
-
lines = [f"<{self._cls_name}>"]
|
|
237
|
-
for kind, label, value in self._items:
|
|
238
|
-
if kind == "row":
|
|
239
|
-
lines.append(f" {label}: {value}")
|
|
240
|
-
else:
|
|
241
|
-
lines.append(f" ({label})")
|
|
242
|
-
return "\n".join(lines)
|
|
243
|
-
|
|
244
|
-
def to_html(self):
|
|
245
|
-
rows = [_html_row("Type", self._type_display)]
|
|
246
|
-
for label, value in self._header_rows:
|
|
247
|
-
rows.append(_html_row(label, value))
|
|
248
|
-
for kind, label, value in self._items:
|
|
249
|
-
if kind == "row":
|
|
250
|
-
html_label = label[0].upper() + label[1:]
|
|
251
|
-
rows.append(_html_row(html_label, value))
|
|
252
|
-
else:
|
|
253
|
-
rows.append(
|
|
254
|
-
f"<tr><td colspan='2'><i>{_html.escape(str(label))}</i></td></tr>"
|
|
255
|
-
)
|
|
256
|
-
table_rows = "\n".join(rows)
|
|
257
|
-
esc_name = _html.escape(str(self._cls_name))
|
|
258
|
-
return (
|
|
259
|
-
f"<table border='1' class='dataframe'>\n"
|
|
260
|
-
f" <thead><tr><th colspan='2'>{esc_name}</th></tr></thead>\n"
|
|
261
|
-
f" <tbody>\n{table_rows}\n </tbody>\n</table>"
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
def _build_windowed_repr(
|
|
266
|
-
cls_name, n_windows, mne_obj, crop_inds, description, metadata
|
|
267
|
-
):
|
|
268
|
-
"""Build repr for EEGWindowsDataset and WindowsDataset."""
|
|
269
|
-
b = _ReprBuilder(cls_name)
|
|
270
|
-
n_ch, type_str, sfreq = _channel_info(mne_obj)
|
|
271
|
-
b.add_header(f"{n_windows} windows", "Windows", n_windows)
|
|
272
|
-
b.add_header(f"{n_ch} ch ({type_str})", "Channels", f"{n_ch} ({type_str})")
|
|
273
|
-
wi = _window_info(crop_inds, sfreq)
|
|
274
|
-
if wi is not None:
|
|
275
|
-
win_samples, win_secs = wi
|
|
276
|
-
b.add_header(
|
|
277
|
-
f"{win_samples} samples/win ({win_secs:.3f} s)",
|
|
278
|
-
"Window size",
|
|
279
|
-
f"{win_samples} samples ({win_secs:.3f} s)",
|
|
280
|
-
)
|
|
281
|
-
b.add_header(f"{sfreq:.1f} Hz", "Sfreq", f"{sfreq:.1f} Hz")
|
|
282
|
-
if description is not None:
|
|
283
|
-
desc_items = ", ".join(f"{k}={v}" for k, v in description.items())
|
|
284
|
-
b.add_row("description", desc_items)
|
|
285
|
-
if metadata is not None:
|
|
286
|
-
summary = _metadata_summary(metadata)
|
|
287
|
-
if summary["is_lazy"]:
|
|
288
|
-
b.add_row("metadata", f"lazy ({summary['n_windows']} windows)")
|
|
289
|
-
else:
|
|
290
|
-
if summary["target_info"]:
|
|
291
|
-
b.add_row("targets", summary["target_info"])
|
|
292
|
-
if summary["extra_columns"]:
|
|
293
|
-
b.add_row("extra metadata", ", ".join(summary["extra_columns"]))
|
|
294
|
-
return b
|
|
295
|
-
|
|
296
|
-
|
|
297
45
|
class RecordDataset(Dataset[tuple[np.ndarray, int | str, tuple[int, int, int]]]):
|
|
298
46
|
def __init__(
|
|
299
47
|
self,
|
|
@@ -346,15 +94,6 @@ class RecordDataset(Dataset[tuple[np.ndarray, int | str, tuple[int, int, int]]])
|
|
|
346
94
|
raise ValueError("Transform needs to be a callable.")
|
|
347
95
|
self._transform = value
|
|
348
96
|
|
|
349
|
-
def _build_repr(self):
|
|
350
|
-
return _ReprBuilder(type(self).__name__)
|
|
351
|
-
|
|
352
|
-
def __repr__(self):
|
|
353
|
-
return self._build_repr().to_repr()
|
|
354
|
-
|
|
355
|
-
def _repr_html_(self):
|
|
356
|
-
return self._build_repr().to_html()
|
|
357
|
-
|
|
358
97
|
|
|
359
98
|
# Type of the datasets contained in BaseConcatDataset
|
|
360
99
|
T = TypeVar("T", bound=RecordDataset)
|
|
@@ -409,23 +148,6 @@ class RawDataset(RecordDataset):
|
|
|
409
148
|
def __len__(self):
|
|
410
149
|
return len(self.raw)
|
|
411
150
|
|
|
412
|
-
def _build_repr(self):
|
|
413
|
-
b = _ReprBuilder(type(self).__name__)
|
|
414
|
-
n_ch, type_str, sfreq = _channel_info(self.raw)
|
|
415
|
-
n_times = len(self.raw.times)
|
|
416
|
-
duration = n_times / sfreq
|
|
417
|
-
b.add_header(f"{n_ch} ch ({type_str})", "Channels", f"{n_ch} ({type_str})")
|
|
418
|
-
b.add_header(f"{sfreq:.1f} Hz", "Sfreq", f"{sfreq:.1f} Hz")
|
|
419
|
-
b.add_header(
|
|
420
|
-
f"{n_times} samples ({duration:.1f} s)",
|
|
421
|
-
"Samples",
|
|
422
|
-
f"{n_times} ({duration:.1f} s)",
|
|
423
|
-
)
|
|
424
|
-
if self.description is not None:
|
|
425
|
-
desc_items = ", ".join(f"{k}={v}" for k, v in self.description.items())
|
|
426
|
-
b.add_row("description", desc_items)
|
|
427
|
-
return b
|
|
428
|
-
|
|
429
151
|
def _target_name(self, target_name):
|
|
430
152
|
if target_name is not None and not isinstance(target_name, (str, tuple, list)):
|
|
431
153
|
raise ValueError("target_name has to be None, str, tuple or list")
|
|
@@ -569,16 +291,6 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
569
291
|
def __len__(self):
|
|
570
292
|
return len(self.crop_inds)
|
|
571
293
|
|
|
572
|
-
def _build_repr(self):
|
|
573
|
-
return _build_windowed_repr(
|
|
574
|
-
type(self).__name__,
|
|
575
|
-
len(self),
|
|
576
|
-
self.raw,
|
|
577
|
-
self.crop_inds,
|
|
578
|
-
self.description,
|
|
579
|
-
self.metadata,
|
|
580
|
-
)
|
|
581
|
-
|
|
582
294
|
|
|
583
295
|
@register_dataset
|
|
584
296
|
class WindowsDataset(RecordDataset):
|
|
@@ -671,16 +383,6 @@ class WindowsDataset(RecordDataset):
|
|
|
671
383
|
def __len__(self) -> int:
|
|
672
384
|
return len(self.windows.events)
|
|
673
385
|
|
|
674
|
-
def _build_repr(self):
|
|
675
|
-
return _build_windowed_repr(
|
|
676
|
-
type(self).__name__,
|
|
677
|
-
len(self),
|
|
678
|
-
self.windows,
|
|
679
|
-
self.crop_inds,
|
|
680
|
-
self.description,
|
|
681
|
-
self.windows.metadata,
|
|
682
|
-
)
|
|
683
|
-
|
|
684
386
|
|
|
685
387
|
@register_dataset
|
|
686
388
|
class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
@@ -1185,101 +887,3 @@ class BaseConcatDataset(ConcatDataset, HubDatasetMixin, Generic[T]):
|
|
|
1185
887
|
target_file_path = os.path.join(sub_dir, "target_name.json")
|
|
1186
888
|
with open(target_file_path, "w") as f:
|
|
1187
889
|
json.dump({"target_name": ds.target_name}, f)
|
|
1188
|
-
|
|
1189
|
-
@staticmethod
|
|
1190
|
-
def _signal_summary(ds):
|
|
1191
|
-
"""Return (mne_obj, is_windowed) from a dataset."""
|
|
1192
|
-
if hasattr(ds, "windows"):
|
|
1193
|
-
mne_obj = ds.windows
|
|
1194
|
-
elif hasattr(ds, "raw"):
|
|
1195
|
-
mne_obj = ds.raw
|
|
1196
|
-
else:
|
|
1197
|
-
return None, False
|
|
1198
|
-
is_windowed = hasattr(ds, "crop_inds")
|
|
1199
|
-
return mne_obj, is_windowed
|
|
1200
|
-
|
|
1201
|
-
def _build_repr(self):
|
|
1202
|
-
n_ds = len(self.datasets)
|
|
1203
|
-
b = _ReprBuilder("BaseConcatDataset")
|
|
1204
|
-
if n_ds == 0:
|
|
1205
|
-
b.add_header("0 datasets", "Recordings", 0)
|
|
1206
|
-
return b
|
|
1207
|
-
|
|
1208
|
-
n_total = len(self)
|
|
1209
|
-
ds_type = type(self.datasets[0]).__name__
|
|
1210
|
-
first_ds = self.datasets[0]
|
|
1211
|
-
mne_obj, is_windowed = self._signal_summary(first_ds)
|
|
1212
|
-
|
|
1213
|
-
b._type_display = f"BaseConcatDataset of {ds_type}"
|
|
1214
|
-
b.add_header(f"{n_ds} {ds_type}(s)", "Recordings", n_ds)
|
|
1215
|
-
b.add_header(f"{n_total} total samples", "Total samples", n_total)
|
|
1216
|
-
|
|
1217
|
-
if mne_obj is not None:
|
|
1218
|
-
n_ch, type_str, sfreq = _channel_info(mne_obj)
|
|
1219
|
-
b.add_row("Sfreq*", f"{sfreq:.1f} Hz")
|
|
1220
|
-
b.add_row("Channels*", f"{n_ch} ({type_str})")
|
|
1221
|
-
|
|
1222
|
-
ch_names = mne_obj.info["ch_names"]
|
|
1223
|
-
if len(ch_names) <= 10:
|
|
1224
|
-
ch_str = ", ".join(ch_names)
|
|
1225
|
-
else:
|
|
1226
|
-
ch_str = (
|
|
1227
|
-
", ".join(ch_names[:10]) + f", ... (+{len(ch_names) - 10} more)"
|
|
1228
|
-
)
|
|
1229
|
-
b.add_row("Ch. names*", ch_str)
|
|
1230
|
-
|
|
1231
|
-
montage = mne_obj.get_montage()
|
|
1232
|
-
if montage is not None:
|
|
1233
|
-
b.add_row("Montage*", montage.get_positions()["coord_frame"])
|
|
1234
|
-
|
|
1235
|
-
if not is_windowed:
|
|
1236
|
-
n_times = len(mne_obj.times)
|
|
1237
|
-
duration = n_times / sfreq
|
|
1238
|
-
b.add_row("Duration*", f"{duration:.1f} s")
|
|
1239
|
-
|
|
1240
|
-
b.add_footnote("* from first recording")
|
|
1241
|
-
|
|
1242
|
-
desc = self.description
|
|
1243
|
-
if desc is not None and not desc.empty:
|
|
1244
|
-
col_str = ", ".join(str(c) for c in desc.columns)
|
|
1245
|
-
b.add_row(
|
|
1246
|
-
"Description",
|
|
1247
|
-
f"{desc.shape[0]} recordings × {desc.shape[1]} columns [{col_str}]",
|
|
1248
|
-
)
|
|
1249
|
-
|
|
1250
|
-
if is_windowed:
|
|
1251
|
-
try:
|
|
1252
|
-
summary = _concat_metadata_summary(self.datasets)
|
|
1253
|
-
if summary["window_info"] is not None and mne_obj is not None:
|
|
1254
|
-
wi = summary["window_info"]
|
|
1255
|
-
if wi["uniform"]:
|
|
1256
|
-
win_secs = wi["min"] / sfreq
|
|
1257
|
-
b.add_row(
|
|
1258
|
-
"Window",
|
|
1259
|
-
f"{wi['min']} samples ({win_secs:.3f} s)",
|
|
1260
|
-
)
|
|
1261
|
-
else:
|
|
1262
|
-
min_secs = wi["min"] / sfreq
|
|
1263
|
-
max_secs = wi["max"] / sfreq
|
|
1264
|
-
b.add_row(
|
|
1265
|
-
"Window",
|
|
1266
|
-
f"{wi['min']}-{wi['max']} samples"
|
|
1267
|
-
f" ({min_secs:.3f}-{max_secs:.3f} s)",
|
|
1268
|
-
)
|
|
1269
|
-
if summary["target_info"]:
|
|
1270
|
-
b.add_row("Targets", summary["target_info"])
|
|
1271
|
-
if summary["extra_columns"]:
|
|
1272
|
-
b.add_row(
|
|
1273
|
-
"Extra meta",
|
|
1274
|
-
", ".join(summary["extra_columns"]),
|
|
1275
|
-
)
|
|
1276
|
-
except (TypeError, AttributeError):
|
|
1277
|
-
pass
|
|
1278
|
-
|
|
1279
|
-
return b
|
|
1280
|
-
|
|
1281
|
-
def __repr__(self):
|
|
1282
|
-
return self._build_repr().to_repr()
|
|
1283
|
-
|
|
1284
|
-
def _repr_html_(self):
|
|
1285
|
-
return self._build_repr().to_html()
|