Braindecode 1.3.0.dev177147151__tar.gz → 1.3.0.dev177509039__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.0.dev177147151/braindecode.egg-info → braindecode-1.3.0.dev177509039}/PKG-INFO +2 -4
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/augmentation/base.py +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/__init__.py +4 -12
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/base.py +136 -103
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/bcicomp.py +3 -3
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/bids.py +3 -3
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/experimental.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/mne.py +5 -3
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/moabb.py +7 -17
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/nmt.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/sleep_physio_challe_18.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/sleep_physionet.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/tuh.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/xy.py +2 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datautil/__init__.py +1 -11
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datautil/serialization.py +8 -7
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/__init__.py +0 -4
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/atcnet.py +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/attn_sleep.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/contrawr.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/ctnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/deepsleepnet.py +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegitnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegminer.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegtcnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/fbcnet.py +1 -5
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/fblightconvnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/fbmsnet.py +6 -20
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/ifnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/labram.py +4 -6
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/msvtnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/patchedtransformer.py +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/signal_jepa.py +3 -5
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sinc_shallow.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/summary.csv +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/syncnet.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/tcn.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/util.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/filter.py +6 -0
- braindecode-1.3.0.dev177509039/braindecode/preprocessing/__init__.py +37 -0
- braindecode-1.3.0.dev177509039/braindecode/preprocessing/mne_preprocess.py +77 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/preprocessing/preprocess.py +51 -146
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/preprocessing/windowers.py +18 -24
- braindecode-1.3.0.dev177509039/braindecode/version.py +1 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039/braindecode.egg-info}/PKG-INFO +2 -4
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode.egg-info/SOURCES.txt +0 -5
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode.egg-info/requires.txt +1 -4
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/api.rst +6 -125
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/conf.py +0 -27
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/whats_new.rst +0 -16
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/pyproject.toml +1 -2
- braindecode-1.3.0.dev177147151/braindecode/datautil/channel_utils.py +0 -114
- braindecode-1.3.0.dev177147151/braindecode/models/eegsym.py +0 -917
- braindecode-1.3.0.dev177147151/braindecode/models/medformer.py +0 -758
- braindecode-1.3.0.dev177147151/braindecode/preprocessing/__init__.py +0 -271
- braindecode-1.3.0.dev177147151/braindecode/preprocessing/eegprep_preprocess.py +0 -1317
- braindecode-1.3.0.dev177147151/braindecode/preprocessing/mne_preprocess.py +0 -240
- braindecode-1.3.0.dev177147151/braindecode/preprocessing/util.py +0 -177
- braindecode-1.3.0.dev177147151/braindecode/version.py +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/LICENSE.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/MANIFEST.in +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/NOTICE.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/README.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/classifier.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/base.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/bendr.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/attention.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/regressor.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/Makefile +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/cite.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/help.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/index.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/install/install.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/models.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/setup.cfg +0 -0
{braindecode-1.3.0.dev177147151/braindecode.egg-info → braindecode-1.3.0.dev177509039}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: braindecode
|
|
3
|
-
Version: 1.3.0.
|
|
3
|
+
Version: 1.3.0.dev177509039
|
|
4
4
|
Summary: Deep learning software to decode EEG, ECG or MEG signals
|
|
5
5
|
Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>
|
|
6
6
|
Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
|
|
@@ -40,8 +40,6 @@ Requires-Dist: linear_attention_transformer
|
|
|
40
40
|
Requires-Dist: docstring_inheritance
|
|
41
41
|
Provides-Extra: moabb
|
|
42
42
|
Requires-Dist: moabb>=1.2.0; extra == "moabb"
|
|
43
|
-
Provides-Extra: eegprep
|
|
44
|
-
Requires-Dist: eegprep[eeglabio]>=0.1.1; extra == "eegprep"
|
|
45
43
|
Provides-Extra: hug
|
|
46
44
|
Requires-Dist: huggingface_hub[torch]>=0.20.0; extra == "hug"
|
|
47
45
|
Provides-Extra: tests
|
|
@@ -69,7 +67,7 @@ Requires-Dist: pre-commit; extra == "docs"
|
|
|
69
67
|
Requires-Dist: openneuro-py; extra == "docs"
|
|
70
68
|
Requires-Dist: plotly; extra == "docs"
|
|
71
69
|
Provides-Extra: all
|
|
72
|
-
Requires-Dist: braindecode[docs,
|
|
70
|
+
Requires-Dist: braindecode[docs,hug,moabb,tests]; extra == "all"
|
|
73
71
|
Dynamic: license-file
|
|
74
72
|
|
|
75
73
|
.. image:: https://badges.gitter.im/braindecodechat/community.svg
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/augmentation/base.py
RENAMED
|
@@ -189,7 +189,7 @@ class AugmentedDataLoader(DataLoader):
|
|
|
189
189
|
|
|
190
190
|
Parameters
|
|
191
191
|
----------
|
|
192
|
-
dataset :
|
|
192
|
+
dataset : BaseDataset
|
|
193
193
|
The dataset containing the signals.
|
|
194
194
|
transforms : list | Transform, optional
|
|
195
195
|
Transform or sequence of Transform to be applied to each batch.
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/__init__.py
RENAMED
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Loader code for some datasets.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from .base import
|
|
6
|
-
BaseConcatDataset,
|
|
7
|
-
EEGWindowsDataset,
|
|
8
|
-
RawDataset,
|
|
9
|
-
RecordDataset,
|
|
10
|
-
WindowsDataset,
|
|
11
|
-
)
|
|
5
|
+
from .base import BaseConcatDataset, BaseDataset, WindowsDataset
|
|
12
6
|
from .bcicomp import BCICompetitionIVDataset4
|
|
13
7
|
from .bids import BIDSDataset, BIDSEpochsDataset
|
|
14
8
|
from .mne import create_from_mne_epochs, create_from_mne_raw
|
|
15
|
-
from .moabb import
|
|
9
|
+
from .moabb import BNCI2014001, HGD, MOABBDataset
|
|
16
10
|
from .nmt import NMT
|
|
17
11
|
from .sleep_physio_challe_18 import SleepPhysionetChallenge2018
|
|
18
12
|
from .sleep_physionet import SleepPhysionet
|
|
@@ -21,15 +15,13 @@ from .xy import create_from_X_y
|
|
|
21
15
|
|
|
22
16
|
__all__ = [
|
|
23
17
|
"WindowsDataset",
|
|
24
|
-
"
|
|
25
|
-
"RecordDataset",
|
|
26
|
-
"RawDataset",
|
|
18
|
+
"BaseDataset",
|
|
27
19
|
"BaseConcatDataset",
|
|
28
20
|
"BIDSDataset",
|
|
29
21
|
"BIDSEpochsDataset",
|
|
30
22
|
"MOABBDataset",
|
|
31
23
|
"HGD",
|
|
32
|
-
"
|
|
24
|
+
"BNCI2014001",
|
|
33
25
|
"create_from_mne_raw",
|
|
34
26
|
"create_from_mne_epochs",
|
|
35
27
|
"TUH",
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/base.py
RENAMED
|
@@ -16,17 +16,14 @@ import json
|
|
|
16
16
|
import os
|
|
17
17
|
import shutil
|
|
18
18
|
import warnings
|
|
19
|
-
from abc import abstractmethod
|
|
20
19
|
from collections.abc import Callable
|
|
21
20
|
from glob import glob
|
|
22
|
-
from typing import
|
|
21
|
+
from typing import Iterable, no_type_check
|
|
23
22
|
|
|
24
23
|
import mne.io
|
|
25
24
|
import numpy as np
|
|
26
25
|
import pandas as pd
|
|
27
|
-
from mne.utils.docs import deprecated
|
|
28
26
|
from torch.utils.data import ConcatDataset, Dataset
|
|
29
|
-
from typing_extensions import TypeVar
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
def _create_description(description) -> pd.Series:
|
|
@@ -40,64 +37,7 @@ def _create_description(description) -> pd.Series:
|
|
|
40
37
|
return description
|
|
41
38
|
|
|
42
39
|
|
|
43
|
-
class
|
|
44
|
-
def __init__(
|
|
45
|
-
self,
|
|
46
|
-
description: dict | pd.Series | None = None,
|
|
47
|
-
transform: Callable | None = None,
|
|
48
|
-
):
|
|
49
|
-
self._description = _create_description(description)
|
|
50
|
-
self.transform = transform
|
|
51
|
-
|
|
52
|
-
@abstractmethod
|
|
53
|
-
def __len__(self) -> int:
|
|
54
|
-
pass
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def description(self) -> pd.Series:
|
|
58
|
-
return self._description
|
|
59
|
-
|
|
60
|
-
def set_description(self, description: dict | pd.Series, overwrite: bool = False):
|
|
61
|
-
"""Update (add or overwrite) the dataset description.
|
|
62
|
-
|
|
63
|
-
Parameters
|
|
64
|
-
----------
|
|
65
|
-
description: dict | pd.Series
|
|
66
|
-
Description in the form key: value.
|
|
67
|
-
overwrite: bool
|
|
68
|
-
Has to be True if a key in description already exists in the
|
|
69
|
-
dataset description.
|
|
70
|
-
"""
|
|
71
|
-
description = _create_description(description)
|
|
72
|
-
if self.description is None:
|
|
73
|
-
self._description = description
|
|
74
|
-
else:
|
|
75
|
-
for key, value in description.items():
|
|
76
|
-
# if the key is already in the existing description, drop it
|
|
77
|
-
if key in self._description:
|
|
78
|
-
assert overwrite, (
|
|
79
|
-
f"'{key}' already in description. Please "
|
|
80
|
-
f"rename or set overwrite to True."
|
|
81
|
-
)
|
|
82
|
-
self._description.pop(key)
|
|
83
|
-
self._description = pd.concat([self.description, description])
|
|
84
|
-
|
|
85
|
-
@property
|
|
86
|
-
def transform(self) -> Callable | None:
|
|
87
|
-
return self._transform
|
|
88
|
-
|
|
89
|
-
@transform.setter
|
|
90
|
-
def transform(self, value: Callable | None):
|
|
91
|
-
if value is not None and not callable(value):
|
|
92
|
-
raise ValueError("Transform needs to be a callable.")
|
|
93
|
-
self._transform = value
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# Type of the datasets contained in BaseConcatDataset
|
|
97
|
-
T = TypeVar("T", bound=RecordDataset)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
class RawDataset(RecordDataset):
|
|
40
|
+
class BaseDataset(Dataset):
|
|
101
41
|
"""Returns samples from an mne.io.Raw object along with a target.
|
|
102
42
|
|
|
103
43
|
Dataset which serves samples from an mne.io.Raw object along with a target.
|
|
@@ -124,12 +64,12 @@ class RawDataset(RecordDataset):
|
|
|
124
64
|
target_name: str | tuple[str, ...] | None = None,
|
|
125
65
|
transform: Callable | None = None,
|
|
126
66
|
):
|
|
127
|
-
super().__init__(description, transform)
|
|
128
67
|
self.raw = raw
|
|
68
|
+
self._description = _create_description(description)
|
|
69
|
+
self.transform = transform
|
|
129
70
|
|
|
130
71
|
# save target name for load/save later
|
|
131
72
|
self.target_name = self._target_name(target_name)
|
|
132
|
-
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
133
73
|
|
|
134
74
|
def __getitem__(self, index):
|
|
135
75
|
X = self.raw[:, index][0]
|
|
@@ -145,6 +85,45 @@ class RawDataset(RecordDataset):
|
|
|
145
85
|
def __len__(self):
|
|
146
86
|
return len(self.raw)
|
|
147
87
|
|
|
88
|
+
@property
|
|
89
|
+
def transform(self):
|
|
90
|
+
return self._transform
|
|
91
|
+
|
|
92
|
+
@transform.setter
|
|
93
|
+
def transform(self, value):
|
|
94
|
+
if value is not None and not callable(value):
|
|
95
|
+
raise ValueError("Transform needs to be a callable.")
|
|
96
|
+
self._transform = value
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def description(self) -> pd.Series:
|
|
100
|
+
return self._description
|
|
101
|
+
|
|
102
|
+
def set_description(self, description: dict | pd.Series, overwrite: bool = False):
|
|
103
|
+
"""Update (add or overwrite) the dataset description.
|
|
104
|
+
|
|
105
|
+
Parameters
|
|
106
|
+
----------
|
|
107
|
+
description: dict | pd.Series
|
|
108
|
+
Description in the form key: value.
|
|
109
|
+
overwrite: bool
|
|
110
|
+
Has to be True if a key in description already exists in the
|
|
111
|
+
dataset description.
|
|
112
|
+
"""
|
|
113
|
+
description = _create_description(description)
|
|
114
|
+
for key, value in description.items():
|
|
115
|
+
# if the key is already in the existing description, drop it
|
|
116
|
+
if self._description is not None and key in self._description:
|
|
117
|
+
assert overwrite, (
|
|
118
|
+
f"'{key}' already in description. Please "
|
|
119
|
+
f"rename or set overwrite to True."
|
|
120
|
+
)
|
|
121
|
+
self._description.pop(key)
|
|
122
|
+
if self._description is None:
|
|
123
|
+
self._description = description
|
|
124
|
+
else:
|
|
125
|
+
self._description = pd.concat([self.description, description])
|
|
126
|
+
|
|
148
127
|
def _target_name(self, target_name):
|
|
149
128
|
if target_name is not None and not isinstance(target_name, (str, tuple, list)):
|
|
150
129
|
raise ValueError("target_name has to be None, str, tuple or list")
|
|
@@ -171,17 +150,7 @@ class RawDataset(RecordDataset):
|
|
|
171
150
|
return target_name if len(target_name) > 1 else target_name[0]
|
|
172
151
|
|
|
173
152
|
|
|
174
|
-
|
|
175
|
-
"The BaseDataset class is deprecated. "
|
|
176
|
-
"If you want to instantiate a dataset containing raws, use RawDataset instead. "
|
|
177
|
-
"If you want to type a Braindecode dataset (i.e. RawDataset|EEGWindowsDataset|WindowsDataset), "
|
|
178
|
-
"use the RecordDataset class instead."
|
|
179
|
-
)
|
|
180
|
-
class BaseDataset(RawDataset):
|
|
181
|
-
pass
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
class EEGWindowsDataset(RecordDataset):
|
|
153
|
+
class EEGWindowsDataset(BaseDataset):
|
|
185
154
|
"""Returns windows from an mne.Raw object, its window indices, along with a target.
|
|
186
155
|
|
|
187
156
|
Dataset which serves windows from an mne.Epochs object along with their
|
|
@@ -192,12 +161,12 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
192
161
|
required to serve information about the windowing (e.g., useful for cropped
|
|
193
162
|
training).
|
|
194
163
|
See `braindecode.datautil.windowers` to directly create a `WindowsDataset`
|
|
195
|
-
from a `
|
|
164
|
+
from a `BaseDataset` object.
|
|
196
165
|
|
|
197
166
|
Parameters
|
|
198
167
|
----------
|
|
199
168
|
windows : mne.Raw or mne.Epochs (Epochs is outdated)
|
|
200
|
-
Windows obtained through the application of a windower to a
|
|
169
|
+
Windows obtained through the application of a windower to a BaseDataset
|
|
201
170
|
(see `braindecode.datautil.windowers`).
|
|
202
171
|
description : dict | pandas.Series | None
|
|
203
172
|
Holds additional info about the windows.
|
|
@@ -216,17 +185,18 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
216
185
|
|
|
217
186
|
def __init__(
|
|
218
187
|
self,
|
|
219
|
-
raw: mne.io.BaseRaw,
|
|
188
|
+
raw: mne.io.BaseRaw | mne.BaseEpochs,
|
|
220
189
|
metadata: pd.DataFrame,
|
|
221
190
|
description: dict | pd.Series | None = None,
|
|
222
191
|
transform: Callable | None = None,
|
|
223
192
|
targets_from: str = "metadata",
|
|
224
193
|
last_target_only: bool = True,
|
|
225
194
|
):
|
|
226
|
-
super().__init__(description, transform)
|
|
227
195
|
self.raw = raw
|
|
228
196
|
self.metadata = metadata
|
|
197
|
+
self._description = _create_description(description)
|
|
229
198
|
|
|
199
|
+
self.transform = transform
|
|
230
200
|
self.last_target_only = last_target_only
|
|
231
201
|
if targets_from not in ("metadata", "channels"):
|
|
232
202
|
raise ValueError("Wrong value for parameter `targets_from`.")
|
|
@@ -236,7 +206,6 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
236
206
|
].to_numpy()
|
|
237
207
|
if self.targets_from == "metadata":
|
|
238
208
|
self.y = metadata.loc[:, "target"].to_list()
|
|
239
|
-
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
240
209
|
|
|
241
210
|
def __getitem__(self, index: int):
|
|
242
211
|
"""Get a window and its target.
|
|
@@ -286,8 +255,44 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
286
255
|
def __len__(self):
|
|
287
256
|
return len(self.crop_inds)
|
|
288
257
|
|
|
258
|
+
@property
|
|
259
|
+
def transform(self):
|
|
260
|
+
return self._transform
|
|
261
|
+
|
|
262
|
+
@transform.setter
|
|
263
|
+
def transform(self, value):
|
|
264
|
+
if value is not None and not callable(value):
|
|
265
|
+
raise ValueError("Transform needs to be a callable.")
|
|
266
|
+
self._transform = value
|
|
267
|
+
|
|
268
|
+
@property
|
|
269
|
+
def description(self) -> pd.Series:
|
|
270
|
+
return self._description
|
|
271
|
+
|
|
272
|
+
def set_description(self, description: dict | pd.Series, overwrite: bool = False):
|
|
273
|
+
"""Update (add or overwrite) the dataset description.
|
|
274
|
+
|
|
275
|
+
Parameters
|
|
276
|
+
----------
|
|
277
|
+
description: dict | pd.Series
|
|
278
|
+
Description in the form key: value.
|
|
279
|
+
overwrite: bool
|
|
280
|
+
Has to be True if a key in description already exists in the
|
|
281
|
+
dataset description.
|
|
282
|
+
"""
|
|
283
|
+
description = _create_description(description)
|
|
284
|
+
for key, value in description.items():
|
|
285
|
+
# if they key is already in the existing description, drop it
|
|
286
|
+
if key in self._description:
|
|
287
|
+
assert overwrite, (
|
|
288
|
+
f"'{key}' already in description. Please "
|
|
289
|
+
f"rename or set overwrite to True."
|
|
290
|
+
)
|
|
291
|
+
self._description.pop(key)
|
|
292
|
+
self._description = pd.concat([self.description, description])
|
|
289
293
|
|
|
290
|
-
|
|
294
|
+
|
|
295
|
+
class WindowsDataset(BaseDataset):
|
|
291
296
|
"""Returns windows from an mne.Epochs object along with a target.
|
|
292
297
|
|
|
293
298
|
Dataset which serves windows from an mne.Epochs object along with their
|
|
@@ -298,12 +303,12 @@ class WindowsDataset(RecordDataset):
|
|
|
298
303
|
required to serve information about the windowing (e.g., useful for cropped
|
|
299
304
|
training).
|
|
300
305
|
See `braindecode.datautil.windowers` to directly create a `WindowsDataset`
|
|
301
|
-
from a
|
|
306
|
+
from a `BaseDataset` object.
|
|
302
307
|
|
|
303
308
|
Parameters
|
|
304
309
|
----------
|
|
305
310
|
windows : mne.Epochs
|
|
306
|
-
Windows obtained through the application of a windower to a
|
|
311
|
+
Windows obtained through the application of a windower to a BaseDataset
|
|
307
312
|
(see `braindecode.datautil.windowers`).
|
|
308
313
|
description : dict | pandas.Series | None
|
|
309
314
|
Holds additional info about the windows.
|
|
@@ -322,22 +327,19 @@ class WindowsDataset(RecordDataset):
|
|
|
322
327
|
targets_from: str = "metadata",
|
|
323
328
|
last_target_only: bool = True,
|
|
324
329
|
):
|
|
325
|
-
super().__init__(description, transform)
|
|
326
330
|
self.windows = windows
|
|
331
|
+
self._description = _create_description(description)
|
|
332
|
+
self.transform = transform
|
|
327
333
|
self.last_target_only = last_target_only
|
|
328
334
|
if targets_from not in ("metadata", "channels"):
|
|
329
335
|
raise ValueError("Wrong value for parameter `targets_from`.")
|
|
330
336
|
self.targets_from = targets_from
|
|
331
337
|
|
|
332
|
-
|
|
333
|
-
assert metadata is not None, "WindowsDataset requires windows with metadata."
|
|
334
|
-
self.crop_inds = metadata.loc[
|
|
338
|
+
self.crop_inds = self.windows.metadata.loc[
|
|
335
339
|
:, ["i_window_in_trial", "i_start_in_trial", "i_stop_in_trial"]
|
|
336
340
|
].to_numpy()
|
|
337
341
|
if self.targets_from == "metadata":
|
|
338
|
-
self.y = metadata.loc[:, "target"].to_list()
|
|
339
|
-
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
340
|
-
self.window_preproc_kwargs: list[dict[str, Any]] = []
|
|
342
|
+
self.y = self.windows.metadata.loc[:, "target"].to_list()
|
|
341
343
|
|
|
342
344
|
def __getitem__(self, index: int):
|
|
343
345
|
"""Get a window and its target.
|
|
@@ -377,8 +379,44 @@ class WindowsDataset(RecordDataset):
|
|
|
377
379
|
def __len__(self) -> int:
|
|
378
380
|
return len(self.windows.events)
|
|
379
381
|
|
|
382
|
+
@property
|
|
383
|
+
def transform(self):
|
|
384
|
+
return self._transform
|
|
385
|
+
|
|
386
|
+
@transform.setter
|
|
387
|
+
def transform(self, value):
|
|
388
|
+
if value is not None and not callable(value):
|
|
389
|
+
raise ValueError("Transform needs to be a callable.")
|
|
390
|
+
self._transform = value
|
|
380
391
|
|
|
381
|
-
|
|
392
|
+
@property
|
|
393
|
+
def description(self) -> pd.Series:
|
|
394
|
+
return self._description
|
|
395
|
+
|
|
396
|
+
def set_description(self, description: dict | pd.Series, overwrite: bool = False):
|
|
397
|
+
"""Update (add or overwrite) the dataset description.
|
|
398
|
+
|
|
399
|
+
Parameters
|
|
400
|
+
----------
|
|
401
|
+
description: dict | pd.Series
|
|
402
|
+
Description in the form key: value.
|
|
403
|
+
overwrite: bool
|
|
404
|
+
Has to be True if a key in description already exists in the
|
|
405
|
+
dataset description.
|
|
406
|
+
"""
|
|
407
|
+
description = _create_description(description)
|
|
408
|
+
for key, value in description.items():
|
|
409
|
+
# if they key is already in the existing description, drop it
|
|
410
|
+
if key in self._description:
|
|
411
|
+
assert overwrite, (
|
|
412
|
+
f"'{key}' already in description. Please "
|
|
413
|
+
f"rename or set overwrite to True."
|
|
414
|
+
)
|
|
415
|
+
self._description.pop(key)
|
|
416
|
+
self._description = pd.concat([self.description, description])
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
class BaseConcatDataset(ConcatDataset):
|
|
382
420
|
"""A base class for concatenated datasets.
|
|
383
421
|
|
|
384
422
|
Holds either mne.Raw or mne.Epoch in self.datasets and has
|
|
@@ -387,27 +425,22 @@ class BaseConcatDataset(ConcatDataset, Generic[T]):
|
|
|
387
425
|
Parameters
|
|
388
426
|
----------
|
|
389
427
|
list_of_ds : list
|
|
390
|
-
list of
|
|
428
|
+
list of BaseDataset, BaseConcatDataset or WindowsDataset
|
|
391
429
|
target_transform : callable | None
|
|
392
430
|
Optional function to call on targets before returning them.
|
|
393
431
|
|
|
394
432
|
"""
|
|
395
433
|
|
|
396
|
-
datasets: list[T]
|
|
397
|
-
|
|
398
434
|
def __init__(
|
|
399
435
|
self,
|
|
400
|
-
list_of_ds: list[
|
|
436
|
+
list_of_ds: list[BaseDataset | BaseConcatDataset | WindowsDataset]
|
|
437
|
+
| None = None,
|
|
401
438
|
target_transform: Callable | None = None,
|
|
402
439
|
):
|
|
403
440
|
# if we get a list of BaseConcatDataset, get all the individual datasets
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
flattened_list_of_ds.extend(ds.datasets)
|
|
408
|
-
else:
|
|
409
|
-
flattened_list_of_ds.append(ds)
|
|
410
|
-
super().__init__(flattened_list_of_ds)
|
|
441
|
+
if list_of_ds and isinstance(list_of_ds[0], BaseConcatDataset):
|
|
442
|
+
list_of_ds = [d for ds in list_of_ds for d in ds.datasets]
|
|
443
|
+
super().__init__(list_of_ds)
|
|
411
444
|
|
|
412
445
|
self.target_transform = target_transform
|
|
413
446
|
|
|
@@ -798,7 +831,7 @@ class BaseConcatDataset(ConcatDataset, Generic[T]):
|
|
|
798
831
|
kwargs = getattr(ds, kwargs_name)
|
|
799
832
|
if kwargs is not None:
|
|
800
833
|
with open(kwargs_file_path, "w") as f:
|
|
801
|
-
json.dump(kwargs, f
|
|
834
|
+
json.dump(kwargs, f)
|
|
802
835
|
|
|
803
836
|
@staticmethod
|
|
804
837
|
def _save_target_name(sub_dir, ds):
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/bcicomp.py
RENAMED
|
@@ -16,7 +16,7 @@ import numpy as np
|
|
|
16
16
|
from mne.utils import verbose
|
|
17
17
|
from scipy.io import loadmat
|
|
18
18
|
|
|
19
|
-
from braindecode.datasets import BaseConcatDataset,
|
|
19
|
+
from braindecode.datasets import BaseConcatDataset, BaseDataset
|
|
20
20
|
|
|
21
21
|
DATASET_URL = (
|
|
22
22
|
"https://stacks.stanford.edu/file/druid:zk881ps0522/"
|
|
@@ -73,8 +73,8 @@ class BCICompetitionIVDataset4(BaseConcatDataset):
|
|
|
73
73
|
file_name=file_path.split("/")[-1],
|
|
74
74
|
session="test",
|
|
75
75
|
)
|
|
76
|
-
datasets.append(
|
|
77
|
-
datasets.append(
|
|
76
|
+
datasets.append(BaseDataset(raw_train, description=desc_train))
|
|
77
|
+
datasets.append(BaseDataset(raw_test, description=desc_test))
|
|
78
78
|
super().__init__(datasets)
|
|
79
79
|
|
|
80
80
|
@staticmethod
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/bids.py
RENAMED
|
@@ -19,7 +19,7 @@ import numpy as np
|
|
|
19
19
|
import pandas as pd
|
|
20
20
|
from joblib import Parallel, delayed
|
|
21
21
|
|
|
22
|
-
from .base import BaseConcatDataset,
|
|
22
|
+
from .base import BaseConcatDataset, BaseDataset, WindowsDataset
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
def _description_from_bids_path(bids_path: mne_bids.BIDSPath) -> dict[str, Any]:
|
|
@@ -186,12 +186,12 @@ class BIDSDataset(BaseConcatDataset):
|
|
|
186
186
|
)
|
|
187
187
|
super().__init__(all_base_ds)
|
|
188
188
|
|
|
189
|
-
def _get_dataset(self, bids_path: mne_bids.BIDSPath) ->
|
|
189
|
+
def _get_dataset(self, bids_path: mne_bids.BIDSPath) -> BaseDataset:
|
|
190
190
|
description = _description_from_bids_path(bids_path)
|
|
191
191
|
raw = mne_bids.read_raw_bids(bids_path, verbose=False)
|
|
192
192
|
if self.preload:
|
|
193
193
|
raw.load_data()
|
|
194
|
-
return
|
|
194
|
+
return BaseDataset(raw, description)
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
class BIDSEpochsDataset(BIDSDataset):
|
|
@@ -25,14 +25,14 @@ class BIDSIterableDataset(IterableDataset):
|
|
|
25
25
|
|
|
26
26
|
Examples
|
|
27
27
|
--------
|
|
28
|
-
>>> from braindecode.datasets import
|
|
28
|
+
>>> from braindecode.datasets import BaseDataset, BaseConcatDataset
|
|
29
29
|
>>> from braindecode.datasets.bids import BIDSIterableDataset, _description_from_bids_path
|
|
30
30
|
>>> from braindecode.preprocessing import create_fixed_length_windows
|
|
31
31
|
>>>
|
|
32
32
|
>>> def my_reader_fn(path):
|
|
33
33
|
... raw = mne_bids.read_raw_bids(path)
|
|
34
34
|
... desc = _description_from_bids_path(path)
|
|
35
|
-
... ds =
|
|
35
|
+
... ds = BaseDataset(raw, description=desc)
|
|
36
36
|
... windows_ds = create_fixed_length_windows(
|
|
37
37
|
... BaseConcatDataset([ds]),
|
|
38
38
|
... window_size_samples=400,
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/mne.py
RENAMED
|
@@ -9,7 +9,7 @@ import mne
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
import pandas as pd
|
|
11
11
|
|
|
12
|
-
from .base import BaseConcatDataset,
|
|
12
|
+
from .base import BaseConcatDataset, BaseDataset, WindowsDataset
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def create_from_mne_raw(
|
|
@@ -75,9 +75,11 @@ def create_from_mne_raw(
|
|
|
75
75
|
f"length of 'raws' ({len(raws)}) and 'description' "
|
|
76
76
|
f"({len(descriptions)}) has to match"
|
|
77
77
|
)
|
|
78
|
-
base_datasets = [
|
|
78
|
+
base_datasets = [
|
|
79
|
+
BaseDataset(raw, desc) for raw, desc in zip(raws, descriptions)
|
|
80
|
+
]
|
|
79
81
|
else:
|
|
80
|
-
base_datasets = [
|
|
82
|
+
base_datasets = [BaseDataset(raw) for raw in raws]
|
|
81
83
|
|
|
82
84
|
base_datasets = BaseConcatDataset(base_datasets)
|
|
83
85
|
windows_datasets = create_windows_from_events(
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/moabb.py
RENAMED
|
@@ -15,11 +15,10 @@ from typing import Any
|
|
|
15
15
|
|
|
16
16
|
import mne
|
|
17
17
|
import pandas as pd
|
|
18
|
-
from mne.utils import deprecated
|
|
19
18
|
|
|
20
19
|
from braindecode.util import _update_moabb_docstring
|
|
21
20
|
|
|
22
|
-
from .base import BaseConcatDataset,
|
|
21
|
+
from .base import BaseConcatDataset, BaseDataset
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
def _find_dataset_in_moabb(dataset_name, dataset_kwargs=None):
|
|
@@ -165,13 +164,13 @@ class MOABBDataset(BaseConcatDataset):
|
|
|
165
164
|
dataset_load_kwargs=dataset_load_kwargs,
|
|
166
165
|
)
|
|
167
166
|
all_base_ds = [
|
|
168
|
-
|
|
167
|
+
BaseDataset(raw, row) for raw, (_, row) in zip(raws, description.iterrows())
|
|
169
168
|
]
|
|
170
169
|
super().__init__(all_base_ds)
|
|
171
170
|
|
|
172
171
|
|
|
173
|
-
class
|
|
174
|
-
doc = """See moabb.datasets.bnci.
|
|
172
|
+
class BNCI2014001(MOABBDataset):
|
|
173
|
+
doc = """See moabb.datasets.bnci.BNCI2014001
|
|
175
174
|
|
|
176
175
|
Parameters
|
|
177
176
|
----------
|
|
@@ -180,14 +179,14 @@ class BNCI2014_001(MOABBDataset):
|
|
|
180
179
|
subjects is fetched.
|
|
181
180
|
"""
|
|
182
181
|
try:
|
|
183
|
-
from moabb.datasets import
|
|
182
|
+
from moabb.datasets import BNCI2014001
|
|
184
183
|
|
|
185
|
-
__doc__ = _update_moabb_docstring(
|
|
184
|
+
__doc__ = _update_moabb_docstring(BNCI2014001, doc)
|
|
186
185
|
except ModuleNotFoundError:
|
|
187
186
|
pass # keep moabb soft dependency, otherwise crash on loading of datasets.__init__.py
|
|
188
187
|
|
|
189
188
|
def __init__(self, subject_ids):
|
|
190
|
-
super().__init__("
|
|
189
|
+
super().__init__("BNCI2014001", subject_ids=subject_ids)
|
|
191
190
|
|
|
192
191
|
|
|
193
192
|
class HGD(MOABBDataset):
|
|
@@ -208,12 +207,3 @@ class HGD(MOABBDataset):
|
|
|
208
207
|
|
|
209
208
|
def __init__(self, subject_ids):
|
|
210
209
|
super().__init__("Schirrmeister2017", subject_ids=subject_ids)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
@deprecated(
|
|
214
|
-
"`BNCI2014001` was renamed to `BNCI2014_001` in v1.13; this alias will be removed in v1.14."
|
|
215
|
-
)
|
|
216
|
-
class BNCI2014001(BNCI2014_001):
|
|
217
|
-
"""Deprecated alias for BNCI2014001."""
|
|
218
|
-
|
|
219
|
-
pass
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/nmt.py
RENAMED
|
@@ -31,7 +31,7 @@ import pandas as pd
|
|
|
31
31
|
from joblib import Parallel, delayed
|
|
32
32
|
from mne.datasets import fetch_dataset
|
|
33
33
|
|
|
34
|
-
from braindecode.datasets.base import BaseConcatDataset,
|
|
34
|
+
from braindecode.datasets.base import BaseConcatDataset, BaseDataset
|
|
35
35
|
|
|
36
36
|
NMT_URL = "https://zenodo.org/record/10909103/files/NMT.zip"
|
|
37
37
|
NMT_archive_name = "NMT.zip"
|
|
@@ -172,7 +172,7 @@ class NMT(BaseConcatDataset):
|
|
|
172
172
|
d["n_samples"] = raw.n_times
|
|
173
173
|
d["sfreq"] = raw.info["sfreq"]
|
|
174
174
|
d["train"] = "train" in d.path.split(os.sep)
|
|
175
|
-
base_dataset =
|
|
175
|
+
base_dataset = BaseDataset(raw, d, target_name)
|
|
176
176
|
return base_dataset
|
|
177
177
|
|
|
178
178
|
|
|
@@ -21,7 +21,7 @@ from mne.datasets.sleep_physionet._utils import _fetch_one
|
|
|
21
21
|
from mne.datasets.utils import _get_path
|
|
22
22
|
from mne.utils import warn
|
|
23
23
|
|
|
24
|
-
from braindecode.datasets import BaseConcatDataset,
|
|
24
|
+
from braindecode.datasets import BaseConcatDataset, BaseDataset
|
|
25
25
|
|
|
26
26
|
PC18_DIR = op.join(op.dirname(__file__), "data", "pc18")
|
|
27
27
|
PC18_RECORDS = op.join(PC18_DIR, "sleep_records.csv")
|
|
@@ -403,7 +403,7 @@ class SleepPhysionetChallenge2018(BaseConcatDataset):
|
|
|
403
403
|
},
|
|
404
404
|
name="",
|
|
405
405
|
)
|
|
406
|
-
base_dataset =
|
|
406
|
+
base_dataset = BaseDataset(raw_file, desc)
|
|
407
407
|
|
|
408
408
|
if preproc is not None:
|
|
409
409
|
from braindecode.preprocessing.preprocess import _preprocess
|
|
@@ -12,7 +12,7 @@ import numpy as np
|
|
|
12
12
|
import pandas as pd
|
|
13
13
|
from mne.datasets.sleep_physionet.age import fetch_data
|
|
14
14
|
|
|
15
|
-
from .base import BaseConcatDataset,
|
|
15
|
+
from .base import BaseConcatDataset, BaseDataset
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class SleepPhysionet(BaseConcatDataset):
|
|
@@ -71,7 +71,7 @@ class SleepPhysionet(BaseConcatDataset):
|
|
|
71
71
|
crop_wake_mins=crop_wake_mins,
|
|
72
72
|
crop=crop,
|
|
73
73
|
)
|
|
74
|
-
base_ds =
|
|
74
|
+
base_ds = BaseDataset(raw, desc)
|
|
75
75
|
all_base_ds.append(base_ds)
|
|
76
76
|
super().__init__(all_base_ds)
|
|
77
77
|
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177509039}/braindecode/datasets/tuh.py
RENAMED
|
@@ -22,7 +22,7 @@ import numpy as np
|
|
|
22
22
|
import pandas as pd
|
|
23
23
|
from joblib import Parallel, delayed
|
|
24
24
|
|
|
25
|
-
from .base import BaseConcatDataset,
|
|
25
|
+
from .base import BaseConcatDataset, BaseDataset
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class TUH(BaseConcatDataset):
|
|
@@ -214,7 +214,7 @@ class TUH(BaseConcatDataset):
|
|
|
214
214
|
d["report"] = physician_report
|
|
215
215
|
additional_description = pd.Series(d)
|
|
216
216
|
description = pd.concat([description, additional_description])
|
|
217
|
-
base_dataset =
|
|
217
|
+
base_dataset = BaseDataset(raw, description, target_name=target_name)
|
|
218
218
|
return base_dataset
|
|
219
219
|
|
|
220
220
|
|