Braindecode 1.3.0.dev177147151__tar.gz → 1.3.0.dev177551367__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.dev177551367}/PKG-INFO +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/base.py +2 -6
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datautil/serialization.py +1 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/__init__.py +0 -2
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/summary.csv +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/util.py +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/__init__.py +0 -5
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/eegprep_preprocess.py +19 -134
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/mne_preprocess.py +25 -56
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/preprocess.py +41 -126
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/util.py +0 -11
- braindecode-1.3.0.dev177551367/braindecode/version.py +1 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367/braindecode.egg-info}/PKG-INFO +1 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode.egg-info/SOURCES.txt +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/api.rst +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/whats_new.rst +0 -2
- braindecode-1.3.0.dev177147151/braindecode/models/medformer.py +0 -758
- braindecode-1.3.0.dev177147151/braindecode/version.py +0 -1
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/LICENSE.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/MANIFEST.in +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/NOTICE.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/README.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/augmentation/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/augmentation/base.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/augmentation/functional.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/augmentation/transforms.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/classifier.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/bbci.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/bcicomp.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/bids.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/experimental.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/mne.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/moabb.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/nmt.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/sleep_physionet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/tuh.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/xy.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datautil/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datautil/channel_utils.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datautil/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/eegneuralnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/functional/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/functional/functions.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/functional/initialization.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/atcnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/attentionbasenet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/attn_sleep.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/base.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/bendr.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/biot.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/contrawr.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/ctnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/deep4.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/deepsleepnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegconformer.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eeginception_erp.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eeginception_mi.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegitnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegminer.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegnex.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegsimpleconv.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegsym.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/eegtcnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/fbcnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/fblightconvnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/fbmsnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/hybrid.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/ifnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/labram.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/msvtnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/patchedtransformer.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sccnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/shallow_fbcsp.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/signal_jepa.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sinc_shallow.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sparcnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/sstdpn.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/syncnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/tcn.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/tidnet.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/tsinception.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/usleep.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/activation.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/attention.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/blocks.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/convolution.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/filter.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/layers.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/linear.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/parametrization.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/stats.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/modules/wrapper.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/preprocessing/windowers.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/regressor.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/samplers/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/samplers/base.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/samplers/ssl.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/training/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/training/callbacks.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/training/losses.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/training/scoring.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/util.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/visualization/__init__.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/visualization/confusion_matrices.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/visualization/gradients.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode.egg-info/dependency_links.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode.egg-info/requires.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode.egg-info/top_level.txt +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/Makefile +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/_templates/autosummary/class.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/_templates/autosummary/function.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/cite.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/conf.py +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/help.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/index.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/install/install.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/install/install_pip.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/install/install_source.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/attention.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/channel.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/convolution.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/filterbank.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/gnn.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/interpretable.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/lbm.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/recurrent.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/categorization/spd.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/models.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/models_categorization.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/models_table.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/models/models_visualization.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/docs/sg_execution_times.rst +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/pyproject.toml +0 -0
- {braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/setup.cfg +0 -0
{braindecode-1.3.0.dev177147151/braindecode.egg-info → braindecode-1.3.0.dev177551367}/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.dev177551367
|
|
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>
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/datasets/base.py
RENAMED
|
@@ -19,7 +19,7 @@ import warnings
|
|
|
19
19
|
from abc import abstractmethod
|
|
20
20
|
from collections.abc import Callable
|
|
21
21
|
from glob import glob
|
|
22
|
-
from typing import
|
|
22
|
+
from typing import Generic, Iterable, no_type_check
|
|
23
23
|
|
|
24
24
|
import mne.io
|
|
25
25
|
import numpy as np
|
|
@@ -129,7 +129,6 @@ class RawDataset(RecordDataset):
|
|
|
129
129
|
|
|
130
130
|
# save target name for load/save later
|
|
131
131
|
self.target_name = self._target_name(target_name)
|
|
132
|
-
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
133
132
|
|
|
134
133
|
def __getitem__(self, index):
|
|
135
134
|
X = self.raw[:, index][0]
|
|
@@ -236,7 +235,6 @@ class EEGWindowsDataset(RecordDataset):
|
|
|
236
235
|
].to_numpy()
|
|
237
236
|
if self.targets_from == "metadata":
|
|
238
237
|
self.y = metadata.loc[:, "target"].to_list()
|
|
239
|
-
self.raw_preproc_kwargs: list[dict[str, Any]] = []
|
|
240
238
|
|
|
241
239
|
def __getitem__(self, index: int):
|
|
242
240
|
"""Get a window and its target.
|
|
@@ -336,8 +334,6 @@ class WindowsDataset(RecordDataset):
|
|
|
336
334
|
].to_numpy()
|
|
337
335
|
if self.targets_from == "metadata":
|
|
338
336
|
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]] = []
|
|
341
337
|
|
|
342
338
|
def __getitem__(self, index: int):
|
|
343
339
|
"""Get a window and its target.
|
|
@@ -798,7 +794,7 @@ class BaseConcatDataset(ConcatDataset, Generic[T]):
|
|
|
798
794
|
kwargs = getattr(ds, kwargs_name)
|
|
799
795
|
if kwargs is not None:
|
|
800
796
|
with open(kwargs_file_path, "w") as f:
|
|
801
|
-
json.dump(kwargs, f
|
|
797
|
+
json.dump(kwargs, f)
|
|
802
798
|
|
|
803
799
|
@staticmethod
|
|
804
800
|
def _save_target_name(sub_dir, ds):
|
|
@@ -302,6 +302,7 @@ def _load_kwargs_json(kwargs_name, sub_dir):
|
|
|
302
302
|
kwargs_file_path = os.path.join(sub_dir, kwargs_file_name)
|
|
303
303
|
if os.path.exists(kwargs_file_path):
|
|
304
304
|
kwargs = json.load(open(kwargs_file_path, "r"))
|
|
305
|
+
kwargs = [tuple(kwarg) for kwarg in kwargs]
|
|
305
306
|
return kwargs
|
|
306
307
|
|
|
307
308
|
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/__init__.py
RENAMED
|
@@ -28,7 +28,6 @@ from .fbmsnet import FBMSNet
|
|
|
28
28
|
from .hybrid import HybridNet
|
|
29
29
|
from .ifnet import IFNet
|
|
30
30
|
from .labram import Labram
|
|
31
|
-
from .medformer import MEDFormer
|
|
32
31
|
from .msvtnet import MSVTNet
|
|
33
32
|
from .patchedtransformer import PBT
|
|
34
33
|
from .sccnet import SCCNet
|
|
@@ -83,7 +82,6 @@ __all__ = [
|
|
|
83
82
|
"HybridNet",
|
|
84
83
|
"IFNet",
|
|
85
84
|
"Labram",
|
|
86
|
-
"MEDFormer",
|
|
87
85
|
"MSVTNet",
|
|
88
86
|
"PBT",
|
|
89
87
|
"SCCNet",
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/summary.csv
RENAMED
|
@@ -41,4 +41,3 @@ IFNet,Motor Imagery,Classification,250,"n_chans, n_outputs, n_times, sfreq",9860
|
|
|
41
41
|
PBT,General,Classification,250,"n_chans, n_outputs, n_times",818948,"PBT(n_chans=22, n_outputs=4, n_times=1000, sfreq=250)","Large Brain Model"
|
|
42
42
|
SSTDPN,Motor Imagery,Classification,250,"n_chans, n_outputs, n_times",19502,"SSTDPN(n_chans=22, n_outputs=4, n_times=1000)","Convolution,Small Attention"
|
|
43
43
|
BENDR,General,"Classification,Embedding",250,"n_chans, n_times, n_outputs",157141049,"BENDR(n_chans=22, n_outputs=4, n_times=1000)","Large Brain Model,Convolution"
|
|
44
|
-
MEDFormer,General,Classification,250,"n_chans, n_outputs, n_times",5313924,"MEDFormer(n_chans=22, n_outputs=4, n_times=1000)","Large Brain Model,Convolution"
|
{braindecode-1.3.0.dev177147151 → braindecode-1.3.0.dev177551367}/braindecode/models/util.py
RENAMED
|
@@ -99,7 +99,6 @@ models_mandatory_parameters = [
|
|
|
99
99
|
("PBT", ["n_chans", "n_outputs", "n_times"], None),
|
|
100
100
|
("SSTDPN", ["n_chans", "n_outputs", "n_times", "sfreq"], None),
|
|
101
101
|
("BENDR", ["n_chans", "n_outputs", "n_times"], None),
|
|
102
|
-
("MEDFormer", ["n_chans", "n_outputs", "n_times"], None),
|
|
103
102
|
]
|
|
104
103
|
|
|
105
104
|
################################################################
|
|
@@ -188,17 +188,12 @@ from .preprocess import (
|
|
|
188
188
|
filterbank,
|
|
189
189
|
preprocess,
|
|
190
190
|
)
|
|
191
|
-
from .util import _init_preprocessor_dict
|
|
192
191
|
from .windowers import (
|
|
193
192
|
create_fixed_length_windows,
|
|
194
193
|
create_windows_from_events,
|
|
195
194
|
create_windows_from_target_channels,
|
|
196
195
|
)
|
|
197
196
|
|
|
198
|
-
# Call this last in order to make sure the list is populated with
|
|
199
|
-
# the preprocessors imported in this file.
|
|
200
|
-
_init_preprocessor_dict()
|
|
201
|
-
|
|
202
197
|
__all__ = [
|
|
203
198
|
"exponential_moving_demean",
|
|
204
199
|
"exponential_moving_standardize",
|
|
@@ -77,14 +77,6 @@ class EEGPrepBasePreprocessor(Preprocessor):
|
|
|
77
77
|
self.record_orig_chanlocs = record_orig_chanlocs
|
|
78
78
|
self.force_dtype = np.dtype(force_dtype) if force_dtype is not None else None
|
|
79
79
|
|
|
80
|
-
@property
|
|
81
|
-
def _all_attrs(self):
|
|
82
|
-
return super()._all_attrs + [
|
|
83
|
-
"can_change_duration",
|
|
84
|
-
"record_orig_chanlocs",
|
|
85
|
-
"force_dtype",
|
|
86
|
-
]
|
|
87
|
-
|
|
88
80
|
@abstractmethod
|
|
89
81
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
90
82
|
"""Apply the preprocessor to an EEGLAB EEG structure. Overridden by subclass."""
|
|
@@ -388,46 +380,31 @@ class EEGPrep(EEGPrepBasePreprocessor):
|
|
|
388
380
|
can_change_duration=can_change_duration or False,
|
|
389
381
|
)
|
|
390
382
|
self.resample_to = resample_to
|
|
391
|
-
self.
|
|
383
|
+
self.reinterpolate = bad_channel_reinterpolate
|
|
392
384
|
self.common_avg_ref = common_avg_ref
|
|
393
385
|
self.burst_removal_cutoff = burst_removal_cutoff
|
|
394
386
|
self.bad_window_max_bad_channels = bad_window_max_bad_channels
|
|
395
|
-
self.bad_channel_corr_threshold = bad_channel_corr_threshold
|
|
396
|
-
self.highpass_frequencies = highpass_frequencies
|
|
397
|
-
self.flatline_maxdur = flatline_maxdur
|
|
398
|
-
self.bad_channel_hf_threshold = bad_channel_hf_threshold
|
|
399
|
-
self.bad_channel_max_broken_time = bad_channel_max_broken_time
|
|
400
|
-
self.bad_window_tolerances = bad_window_tolerances
|
|
401
|
-
self.refdata_max_bad_channels = refdata_max_bad_channels
|
|
402
|
-
self.refdata_max_tolerances = refdata_max_tolerances
|
|
403
|
-
self.num_samples = num_samples
|
|
404
|
-
self.subset_size = subset_size
|
|
405
|
-
self.bad_channel_nolocs_threshold = bad_channel_nolocs_threshold
|
|
406
|
-
self.bad_channel_nolocs_exclude_frac = bad_channel_nolocs_exclude_frac
|
|
407
|
-
self.max_mem_mb = max_mem_mb
|
|
408
387
|
|
|
409
|
-
|
|
410
|
-
def clean_artifacts_params(self):
|
|
411
|
-
if self.bad_channel_corr_threshold is None:
|
|
388
|
+
if bad_channel_corr_threshold is None:
|
|
412
389
|
line_noise_crit = None
|
|
413
390
|
else:
|
|
414
|
-
line_noise_crit =
|
|
415
|
-
|
|
416
|
-
ChannelCriterion=
|
|
391
|
+
line_noise_crit = bad_channel_hf_threshold
|
|
392
|
+
self.clean_artifacts_params = dict(
|
|
393
|
+
ChannelCriterion=bad_channel_corr_threshold,
|
|
417
394
|
LineNoiseCriterion=line_noise_crit,
|
|
418
|
-
BurstCriterion=
|
|
419
|
-
WindowCriterion=
|
|
420
|
-
Highpass=
|
|
421
|
-
ChannelCriterionMaxBadTime=
|
|
422
|
-
BurstCriterionRefMaxBadChns=
|
|
423
|
-
BurstCriterionRefTolerances=
|
|
424
|
-
WindowCriterionTolerances=
|
|
425
|
-
FlatlineCriterion=
|
|
426
|
-
NumSamples=
|
|
427
|
-
SubsetSize=
|
|
428
|
-
NoLocsChannelCriterion=
|
|
429
|
-
NoLocsChannelCriterionExcluded=
|
|
430
|
-
MaxMem=
|
|
395
|
+
BurstCriterion=burst_removal_cutoff,
|
|
396
|
+
WindowCriterion=bad_window_max_bad_channels,
|
|
397
|
+
Highpass=highpass_frequencies,
|
|
398
|
+
ChannelCriterionMaxBadTime=bad_channel_max_broken_time,
|
|
399
|
+
BurstCriterionRefMaxBadChns=refdata_max_bad_channels,
|
|
400
|
+
BurstCriterionRefTolerances=refdata_max_tolerances,
|
|
401
|
+
WindowCriterionTolerances=bad_window_tolerances,
|
|
402
|
+
FlatlineCriterion=flatline_maxdur,
|
|
403
|
+
NumSamples=num_samples,
|
|
404
|
+
SubsetSize=subset_size,
|
|
405
|
+
NoLocsChannelCriterion=bad_channel_nolocs_threshold,
|
|
406
|
+
NoLocsChannelCriterionExcluded=bad_channel_nolocs_exclude_frac,
|
|
407
|
+
MaxMem=max_mem_mb,
|
|
431
408
|
# For reference, the function additionally accepts these (legacy etc.)
|
|
432
409
|
# arguments, which we're not exposing here (current defaults as below):
|
|
433
410
|
# BurstRejection='off',
|
|
@@ -437,29 +414,6 @@ class EEGPrep(EEGPrepBasePreprocessor):
|
|
|
437
414
|
# availableRAM_GB=None,
|
|
438
415
|
)
|
|
439
416
|
|
|
440
|
-
@property
|
|
441
|
-
def _all_attrs(self):
|
|
442
|
-
return super()._all_attrs + [
|
|
443
|
-
"resample_to",
|
|
444
|
-
"bad_channel_reinterpolate",
|
|
445
|
-
"common_avg_ref",
|
|
446
|
-
"burst_removal_cutoff",
|
|
447
|
-
"bad_window_max_bad_channels",
|
|
448
|
-
"bad_channel_corr_threshold",
|
|
449
|
-
"highpass_frequencies",
|
|
450
|
-
"flatline_maxdur",
|
|
451
|
-
"bad_channel_hf_threshold",
|
|
452
|
-
"bad_channel_max_broken_time",
|
|
453
|
-
"bad_window_tolerances",
|
|
454
|
-
"refdata_max_bad_channels",
|
|
455
|
-
"refdata_max_tolerances",
|
|
456
|
-
"num_samples",
|
|
457
|
-
"subset_size",
|
|
458
|
-
"bad_channel_nolocs_threshold",
|
|
459
|
-
"bad_channel_nolocs_exclude_frac",
|
|
460
|
-
"max_mem_mb",
|
|
461
|
-
]
|
|
462
|
-
|
|
463
417
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
464
418
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
465
419
|
# remove per-channel DC offset (can be huge)
|
|
@@ -495,9 +449,7 @@ class EEGPrep(EEGPrepBasePreprocessor):
|
|
|
495
449
|
eeg["data"] = eeg["data"].astype(np.float32)
|
|
496
450
|
|
|
497
451
|
# optionally reinterpolate dropped channels
|
|
498
|
-
if self.
|
|
499
|
-
len(orig_chanlocs) > len(eeg["chanlocs"])
|
|
500
|
-
):
|
|
452
|
+
if self.reinterpolate and (len(orig_chanlocs) > len(eeg["chanlocs"])):
|
|
501
453
|
eeg = eegprep.eeg_interp(eeg, orig_chanlocs)
|
|
502
454
|
|
|
503
455
|
# optionally apply common average reference
|
|
@@ -561,13 +513,6 @@ class RemoveFlatChannels(EEGPrepBasePreprocessor):
|
|
|
561
513
|
self.max_flatline_duration = max_flatline_duration
|
|
562
514
|
self.max_allowed_jitter = max_allowed_jitter
|
|
563
515
|
|
|
564
|
-
@property
|
|
565
|
-
def _all_attrs(self):
|
|
566
|
-
return super()._all_attrs + [
|
|
567
|
-
"max_flatline_duration",
|
|
568
|
-
"max_allowed_jitter",
|
|
569
|
-
]
|
|
570
|
-
|
|
571
516
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
572
517
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
573
518
|
eeg = eegprep.clean_flatlines(
|
|
@@ -664,14 +609,6 @@ class RemoveDrifts(EEGPrepBasePreprocessor):
|
|
|
664
609
|
self.attenuation = attenuation
|
|
665
610
|
self.method = method
|
|
666
611
|
|
|
667
|
-
@property
|
|
668
|
-
def _all_attrs(self):
|
|
669
|
-
return super()._all_attrs + [
|
|
670
|
-
"transition",
|
|
671
|
-
"attenuation",
|
|
672
|
-
"method",
|
|
673
|
-
]
|
|
674
|
-
|
|
675
612
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
676
613
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
677
614
|
eeg = eegprep.clean_drifts(
|
|
@@ -738,10 +675,6 @@ class Resampling(EEGPrepBasePreprocessor):
|
|
|
738
675
|
super().__init__(can_change_duration=True)
|
|
739
676
|
self.sfreq = sfreq
|
|
740
677
|
|
|
741
|
-
@property
|
|
742
|
-
def _all_attrs(self):
|
|
743
|
-
return super()._all_attrs + ["sfreq"]
|
|
744
|
-
|
|
745
678
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
746
679
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
747
680
|
if self.sfreq is not None:
|
|
@@ -846,17 +779,6 @@ class RemoveBadChannels(EEGPrepBasePreprocessor):
|
|
|
846
779
|
self.num_samples = num_samples
|
|
847
780
|
self.subset_size = subset_size
|
|
848
781
|
|
|
849
|
-
@property
|
|
850
|
-
def _all_attrs(self):
|
|
851
|
-
return super()._all_attrs + [
|
|
852
|
-
"corr_threshold",
|
|
853
|
-
"noise_threshold",
|
|
854
|
-
"window_len",
|
|
855
|
-
"max_broken_time",
|
|
856
|
-
"num_samples",
|
|
857
|
-
"subset_size",
|
|
858
|
-
]
|
|
859
|
-
|
|
860
782
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
861
783
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
862
784
|
eeg = eegprep.clean_channels(
|
|
@@ -947,16 +869,6 @@ class RemoveBadChannelsNoLocs(EEGPrepBasePreprocessor):
|
|
|
947
869
|
self.max_broken_time = max_broken_time
|
|
948
870
|
self.linenoise_aware = linenoise_aware
|
|
949
871
|
|
|
950
|
-
@property
|
|
951
|
-
def _all_attrs(self):
|
|
952
|
-
return super()._all_attrs + [
|
|
953
|
-
"min_corr",
|
|
954
|
-
"ignored_quantile",
|
|
955
|
-
"window_len",
|
|
956
|
-
"max_broken_time",
|
|
957
|
-
"linenoise_aware",
|
|
958
|
-
]
|
|
959
|
-
|
|
960
872
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
961
873
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
962
874
|
eeg, _ = eegprep.clean_channels_nolocs(
|
|
@@ -1070,19 +982,6 @@ class RemoveBursts(EEGPrepBasePreprocessor):
|
|
|
1070
982
|
self.ref_wndlen = ref_wndlen
|
|
1071
983
|
self.maxmem = maxmem
|
|
1072
984
|
|
|
1073
|
-
@property
|
|
1074
|
-
def _all_attrs(self):
|
|
1075
|
-
return super()._all_attrs + [
|
|
1076
|
-
"cutoff",
|
|
1077
|
-
"window_len",
|
|
1078
|
-
"step_size",
|
|
1079
|
-
"max_dims",
|
|
1080
|
-
"ref_maxbadchannels",
|
|
1081
|
-
"ref_tolerances",
|
|
1082
|
-
"ref_wndlen",
|
|
1083
|
-
"maxmem",
|
|
1084
|
-
]
|
|
1085
|
-
|
|
1086
985
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
1087
986
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
1088
987
|
eeg = eegprep.clean_asr(
|
|
@@ -1199,20 +1098,6 @@ class RemoveBadWindows(EEGPrepBasePreprocessor):
|
|
|
1199
1098
|
self.step_sizes = step_sizes
|
|
1200
1099
|
self.shape_range = shape_range
|
|
1201
1100
|
|
|
1202
|
-
@property
|
|
1203
|
-
def _all_attrs(self):
|
|
1204
|
-
return super()._all_attrs + [
|
|
1205
|
-
"max_bad_channels",
|
|
1206
|
-
"zthresholds",
|
|
1207
|
-
"window_len",
|
|
1208
|
-
"window_overlap",
|
|
1209
|
-
"max_dropout_fraction",
|
|
1210
|
-
"min_clean_fraction",
|
|
1211
|
-
"truncate_quant",
|
|
1212
|
-
"step_sizes",
|
|
1213
|
-
"shape_range",
|
|
1214
|
-
]
|
|
1215
|
-
|
|
1216
1101
|
def apply_eeg(self, eeg: dict[str, Any], raw: BaseRaw) -> dict[str, Any]:
|
|
1217
1102
|
"""Apply the preprocessor to an EEGLAB EEG structure."""
|
|
1218
1103
|
eeg, _ = eegprep.clean_windows(
|
|
@@ -38,60 +38,24 @@ def _generate_init_method(func, force_copy_false=False):
|
|
|
38
38
|
force_copy_false : bool
|
|
39
39
|
If True, forces copy=False by default for functions that have a copy parameter.
|
|
40
40
|
"""
|
|
41
|
-
func_name = func.__name__
|
|
42
41
|
parameters = list(inspect.signature(func).parameters.values())
|
|
43
|
-
param_names = [
|
|
44
|
-
param.name
|
|
45
|
-
for param in parameters[1:] # Skip 'self' or 'raw' or 'epochs'
|
|
46
|
-
]
|
|
47
|
-
all_mandatory = [
|
|
48
|
-
param.name
|
|
49
|
-
for param in parameters[1:] # Skip 'self' or 'raw' or 'epochs'
|
|
50
|
-
if param.default == inspect.Parameter.empty
|
|
51
|
-
]
|
|
42
|
+
param_names = [param.name for param in parameters]
|
|
52
43
|
|
|
53
44
|
def init_method(self, *args, **kwargs):
|
|
54
|
-
used = []
|
|
55
|
-
mandatory = list(all_mandatory)
|
|
56
|
-
init_kwargs = {}
|
|
57
|
-
|
|
58
45
|
# For standalone functions with copy parameter, set copy=False by default
|
|
59
46
|
if force_copy_false and "copy" in param_names and "copy" not in kwargs:
|
|
60
47
|
kwargs["copy"] = False
|
|
61
48
|
|
|
62
49
|
for name, value in zip(param_names, args):
|
|
63
|
-
|
|
64
|
-
used.append(name)
|
|
65
|
-
if name in mandatory:
|
|
66
|
-
mandatory.remove(name)
|
|
50
|
+
setattr(self, name, value)
|
|
67
51
|
for name, value in kwargs.items():
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if name not in param_names:
|
|
71
|
-
raise TypeError(
|
|
72
|
-
f"'{name}' is an invalid keyword argument for {func_name}()"
|
|
73
|
-
)
|
|
74
|
-
init_kwargs[name] = value
|
|
75
|
-
if name in mandatory:
|
|
76
|
-
mandatory.remove(name)
|
|
77
|
-
if len(mandatory) > 0:
|
|
78
|
-
raise TypeError(
|
|
79
|
-
f"{func_name}() missing required arguments: {', '.join(mandatory)}"
|
|
80
|
-
)
|
|
81
|
-
Preprocessor.__init__(self, fn=func_name, apply_on_array=False, **init_kwargs)
|
|
52
|
+
setattr(self, name, value)
|
|
53
|
+
self.kwargs = kwargs
|
|
82
54
|
|
|
83
55
|
init_method.__signature__ = inspect.signature(func)
|
|
84
56
|
return init_method
|
|
85
57
|
|
|
86
58
|
|
|
87
|
-
def _generate_repr_method(class_name):
|
|
88
|
-
def repr_method(self):
|
|
89
|
-
args_str = ", ".join(f"{k}={v.__repr__()}" for k, v in self.kwargs.items())
|
|
90
|
-
return f"{class_name}({args_str})"
|
|
91
|
-
|
|
92
|
-
return repr_method
|
|
93
|
-
|
|
94
|
-
|
|
95
59
|
def _generate_mne_pre_processor(function):
|
|
96
60
|
"""
|
|
97
61
|
Generate a class based on an MNE function for preprocessing.
|
|
@@ -105,14 +69,10 @@ def _generate_mne_pre_processor(function):
|
|
|
105
69
|
class_name = "".join(word.title() for word in function.__name__.split("_")).replace(
|
|
106
70
|
"Eeg", "EEG"
|
|
107
71
|
)
|
|
108
|
-
|
|
109
|
-
# Automatically determine if function is standalone
|
|
110
|
-
is_standalone = _is_standalone_function(function)
|
|
111
|
-
|
|
112
72
|
# Create a wrapper note that references the original MNE function
|
|
113
73
|
# For Raw methods, use mne.io.Raw.method_name format with :meth:
|
|
114
74
|
# For standalone functions, use the function name only with :func:
|
|
115
|
-
if
|
|
75
|
+
if hasattr(mne.io.Raw, function.__name__):
|
|
116
76
|
ref_path = f"mne.io.Raw.{function.__name__}"
|
|
117
77
|
ref_role = "meth"
|
|
118
78
|
else:
|
|
@@ -136,10 +96,6 @@ def _generate_mne_pre_processor(function):
|
|
|
136
96
|
|
|
137
97
|
base_classes = (Preprocessor,)
|
|
138
98
|
|
|
139
|
-
# Check if function has a 'copy' parameter
|
|
140
|
-
sig = inspect.signature(function)
|
|
141
|
-
has_copy_param = "copy" in sig.parameters
|
|
142
|
-
force_copy_false = is_standalone and has_copy_param
|
|
143
99
|
# Automatically determine if function is standalone
|
|
144
100
|
is_standalone = _is_standalone_function(function)
|
|
145
101
|
|
|
@@ -147,13 +103,26 @@ def _generate_mne_pre_processor(function):
|
|
|
147
103
|
sig = inspect.signature(function)
|
|
148
104
|
has_copy_param = "copy" in sig.parameters
|
|
149
105
|
force_copy_false = is_standalone and has_copy_param
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
106
|
+
|
|
107
|
+
if is_standalone:
|
|
108
|
+
# For standalone functions, store the actual function object
|
|
109
|
+
class_attrs = {
|
|
110
|
+
"__init__": _generate_init_method(
|
|
111
|
+
function, force_copy_false=force_copy_false
|
|
112
|
+
),
|
|
113
|
+
"__doc__": wrapper_note + (function.__doc__ or ""),
|
|
114
|
+
"fn": function, # Store the function itself, not the name
|
|
115
|
+
"_is_standalone": True,
|
|
116
|
+
}
|
|
117
|
+
else:
|
|
118
|
+
# For methods, store the function name as before
|
|
119
|
+
class_attrs = {
|
|
120
|
+
"__init__": _generate_init_method(function),
|
|
121
|
+
"__doc__": wrapper_note + (function.__doc__ or ""),
|
|
122
|
+
"fn": function.__name__,
|
|
123
|
+
"_is_standalone": False,
|
|
124
|
+
}
|
|
125
|
+
|
|
157
126
|
generated_class = type(class_name, base_classes, class_attrs)
|
|
158
127
|
|
|
159
128
|
return generated_class
|