braindecode 1.3.0.dev177069446__py3-none-any.whl → 1.3.0.dev177628147__py3-none-any.whl
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/augmentation/__init__.py +3 -5
- braindecode/augmentation/base.py +5 -8
- braindecode/augmentation/functional.py +22 -25
- braindecode/augmentation/transforms.py +42 -51
- braindecode/classifier.py +16 -11
- braindecode/datasets/__init__.py +3 -5
- braindecode/datasets/base.py +13 -17
- braindecode/datasets/bbci.py +14 -13
- braindecode/datasets/bcicomp.py +5 -4
- braindecode/datasets/{bids/datasets.py → bids.py} +18 -12
- braindecode/datasets/{bids/iterable.py → experimental.py} +6 -8
- braindecode/datasets/{bids/hub.py → hub.py} +350 -375
- braindecode/datasets/{bids/hub_validation.py → hub_validation.py} +1 -2
- braindecode/datasets/mne.py +19 -19
- braindecode/datasets/moabb.py +10 -10
- braindecode/datasets/nmt.py +56 -58
- braindecode/datasets/sleep_physio_challe_18.py +5 -3
- braindecode/datasets/sleep_physionet.py +5 -5
- braindecode/datasets/tuh.py +18 -21
- braindecode/datasets/xy.py +9 -10
- braindecode/datautil/__init__.py +3 -3
- braindecode/datautil/serialization.py +20 -22
- braindecode/datautil/util.py +7 -120
- braindecode/eegneuralnet.py +52 -22
- braindecode/functional/functions.py +10 -7
- braindecode/functional/initialization.py +2 -3
- braindecode/models/__init__.py +3 -5
- braindecode/models/atcnet.py +39 -43
- braindecode/models/attentionbasenet.py +41 -37
- braindecode/models/attn_sleep.py +24 -26
- braindecode/models/base.py +6 -6
- braindecode/models/bendr.py +26 -50
- braindecode/models/biot.py +30 -61
- braindecode/models/contrawr.py +5 -5
- braindecode/models/ctnet.py +35 -35
- braindecode/models/deep4.py +5 -5
- braindecode/models/deepsleepnet.py +7 -7
- braindecode/models/eegconformer.py +26 -31
- braindecode/models/eeginception_erp.py +2 -2
- braindecode/models/eeginception_mi.py +6 -6
- braindecode/models/eegitnet.py +5 -5
- braindecode/models/eegminer.py +1 -1
- braindecode/models/eegnet.py +3 -3
- braindecode/models/eegnex.py +2 -2
- braindecode/models/eegsimpleconv.py +2 -2
- braindecode/models/eegsym.py +7 -7
- braindecode/models/eegtcnet.py +6 -6
- braindecode/models/fbcnet.py +2 -2
- braindecode/models/fblightconvnet.py +3 -3
- braindecode/models/fbmsnet.py +3 -3
- braindecode/models/hybrid.py +2 -2
- braindecode/models/ifnet.py +5 -5
- braindecode/models/labram.py +46 -70
- braindecode/models/luna.py +5 -60
- braindecode/models/medformer.py +21 -23
- braindecode/models/msvtnet.py +15 -15
- braindecode/models/patchedtransformer.py +55 -55
- braindecode/models/sccnet.py +2 -2
- braindecode/models/shallow_fbcsp.py +3 -5
- braindecode/models/signal_jepa.py +12 -39
- braindecode/models/sinc_shallow.py +4 -3
- braindecode/models/sleep_stager_blanco_2020.py +2 -2
- braindecode/models/sleep_stager_chambon_2018.py +2 -2
- braindecode/models/sparcnet.py +8 -8
- braindecode/models/sstdpn.py +869 -869
- braindecode/models/summary.csv +17 -19
- braindecode/models/syncnet.py +2 -2
- braindecode/models/tcn.py +5 -5
- braindecode/models/tidnet.py +3 -3
- braindecode/models/tsinception.py +3 -3
- braindecode/models/usleep.py +7 -7
- braindecode/models/util.py +14 -165
- braindecode/modules/__init__.py +1 -9
- braindecode/modules/activation.py +3 -29
- braindecode/modules/attention.py +0 -123
- braindecode/modules/blocks.py +1 -53
- braindecode/modules/convolution.py +0 -53
- braindecode/modules/filter.py +0 -31
- braindecode/modules/layers.py +0 -84
- braindecode/modules/linear.py +1 -22
- braindecode/modules/stats.py +0 -10
- braindecode/modules/util.py +0 -9
- braindecode/modules/wrapper.py +0 -17
- braindecode/preprocessing/preprocess.py +0 -3
- braindecode/regressor.py +18 -15
- braindecode/samplers/ssl.py +1 -1
- braindecode/util.py +28 -38
- braindecode/version.py +1 -1
- braindecode-1.3.0.dev177628147.dist-info/METADATA +202 -0
- braindecode-1.3.0.dev177628147.dist-info/RECORD +114 -0
- braindecode/datasets/bids/__init__.py +0 -54
- braindecode/datasets/bids/format.py +0 -717
- braindecode/datasets/bids/hub_format.py +0 -717
- braindecode/datasets/bids/hub_io.py +0 -197
- braindecode/datasets/chb_mit.py +0 -163
- braindecode/datasets/siena.py +0 -162
- braindecode/datasets/utils.py +0 -67
- braindecode/models/brainmodule.py +0 -845
- braindecode/models/config.py +0 -233
- braindecode/models/reve.py +0 -843
- braindecode-1.3.0.dev177069446.dist-info/METADATA +0 -230
- braindecode-1.3.0.dev177069446.dist-info/RECORD +0 -124
- {braindecode-1.3.0.dev177069446.dist-info → braindecode-1.3.0.dev177628147.dist-info}/WHEEL +0 -0
- {braindecode-1.3.0.dev177069446.dist-info → braindecode-1.3.0.dev177628147.dist-info}/licenses/LICENSE.txt +0 -0
- {braindecode-1.3.0.dev177069446.dist-info → braindecode-1.3.0.dev177628147.dist-info}/licenses/NOTICE.txt +0 -0
- {braindecode-1.3.0.dev177069446.dist-info → braindecode-1.3.0.dev177628147.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,7 @@ from braindecode.modules import DepthwiseConv2d, Ensure4d, InceptionBlock
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class EEGInceptionERP(EEGModuleMixin, nn.Sequential):
|
|
16
|
-
|
|
16
|
+
"""EEG Inception for ERP-based from Santamaria-Vazquez et al (2020) [santamaria2020]_.
|
|
17
17
|
|
|
18
18
|
:bdg-success:`Convolution`
|
|
19
19
|
|
|
@@ -176,7 +176,7 @@ class EEGInceptionERP(EEGModuleMixin, nn.Sequential):
|
|
|
176
176
|
drop_prob=0.5,
|
|
177
177
|
scales_samples_s=(0.5, 0.25, 0.125),
|
|
178
178
|
n_filters=8,
|
|
179
|
-
activation:
|
|
179
|
+
activation: nn.Module = nn.ELU,
|
|
180
180
|
batch_norm_alpha=0.01,
|
|
181
181
|
depth_multiplier=2,
|
|
182
182
|
pooling_sizes=(4, 2, 2, 2),
|
|
@@ -11,7 +11,7 @@ from braindecode.modules import Ensure4d
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class EEGInceptionMI(EEGModuleMixin, nn.Module):
|
|
14
|
-
|
|
14
|
+
"""EEG Inception for Motor Imagery, as proposed in Zhang et al. (2021) [1]_
|
|
15
15
|
|
|
16
16
|
:bdg-success:`Convolution`
|
|
17
17
|
|
|
@@ -71,7 +71,7 @@ class EEGInceptionMI(EEGModuleMixin, nn.Module):
|
|
|
71
71
|
n_convs: int = 5,
|
|
72
72
|
n_filters: int = 48,
|
|
73
73
|
kernel_unit_s: float = 0.1,
|
|
74
|
-
activation:
|
|
74
|
+
activation: nn.Module = nn.ReLU,
|
|
75
75
|
chs_info=None,
|
|
76
76
|
n_times=None,
|
|
77
77
|
):
|
|
@@ -208,7 +208,7 @@ class EEGInceptionMI(EEGModuleMixin, nn.Module):
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
class _InceptionModuleMI(nn.Module):
|
|
211
|
-
|
|
211
|
+
"""
|
|
212
212
|
Inception module.
|
|
213
213
|
|
|
214
214
|
This module implements a inception-like architecture that processes input
|
|
@@ -247,7 +247,7 @@ class _InceptionModuleMI(nn.Module):
|
|
|
247
247
|
n_convs,
|
|
248
248
|
kernel_unit_s=0.1,
|
|
249
249
|
sfreq=250,
|
|
250
|
-
activation:
|
|
250
|
+
activation: nn.Module = nn.ReLU,
|
|
251
251
|
):
|
|
252
252
|
super().__init__()
|
|
253
253
|
self.in_channels = in_channels
|
|
@@ -323,7 +323,7 @@ class _InceptionModuleMI(nn.Module):
|
|
|
323
323
|
|
|
324
324
|
|
|
325
325
|
class _ResidualModuleMI(nn.Module):
|
|
326
|
-
|
|
326
|
+
"""
|
|
327
327
|
Residual module.
|
|
328
328
|
|
|
329
329
|
This module performs a 1x1 convolution followed by batch normalization and an activation function.
|
|
@@ -343,7 +343,7 @@ class _ResidualModuleMI(nn.Module):
|
|
|
343
343
|
|
|
344
344
|
"""
|
|
345
345
|
|
|
346
|
-
def __init__(self, in_channels, n_filters, activation:
|
|
346
|
+
def __init__(self, in_channels, n_filters, activation: nn.Module = nn.ReLU):
|
|
347
347
|
super().__init__()
|
|
348
348
|
self.in_channels = in_channels
|
|
349
349
|
self.n_filters = n_filters
|
braindecode/models/eegitnet.py
CHANGED
|
@@ -9,7 +9,7 @@ from braindecode.modules import DepthwiseConv2d, Ensure4d, InceptionBlock
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class EEGITNet(EEGModuleMixin, nn.Sequential):
|
|
12
|
-
|
|
12
|
+
"""EEG-ITNet from Salami, et al (2022) [Salami2022]_
|
|
13
13
|
|
|
14
14
|
:bdg-success:`Convolution` :bdg-secondary:`Recurrent`
|
|
15
15
|
|
|
@@ -83,7 +83,7 @@ class EEGITNet(EEGModuleMixin, nn.Sequential):
|
|
|
83
83
|
tcn_padding: int = 3,
|
|
84
84
|
drop_prob: float = 0.4,
|
|
85
85
|
tcn_dilatation: int = 1,
|
|
86
|
-
activation:
|
|
86
|
+
activation: nn.Module = nn.ELU,
|
|
87
87
|
):
|
|
88
88
|
super().__init__(
|
|
89
89
|
n_outputs=n_outputs,
|
|
@@ -205,7 +205,7 @@ class EEGITNet(EEGModuleMixin, nn.Sequential):
|
|
|
205
205
|
out_channels,
|
|
206
206
|
kernel_length,
|
|
207
207
|
depth_multiplier=1,
|
|
208
|
-
activation:
|
|
208
|
+
activation: nn.Module = nn.ELU,
|
|
209
209
|
):
|
|
210
210
|
return nn.Sequential(
|
|
211
211
|
nn.Conv2d(
|
|
@@ -229,7 +229,7 @@ class EEGITNet(EEGModuleMixin, nn.Sequential):
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
class _TCBlock(nn.Module):
|
|
232
|
-
|
|
232
|
+
"""
|
|
233
233
|
Temporal Convolutional (TC) block.
|
|
234
234
|
|
|
235
235
|
This module applies two depthwise separable convolutions with dilation and residual
|
|
@@ -260,7 +260,7 @@ class _TCBlock(nn.Module):
|
|
|
260
260
|
dilatation,
|
|
261
261
|
padding,
|
|
262
262
|
drop_prob=0.4,
|
|
263
|
-
activation:
|
|
263
|
+
activation: nn.Module = nn.ELU,
|
|
264
264
|
):
|
|
265
265
|
super().__init__()
|
|
266
266
|
self.pad = padding
|
braindecode/models/eegminer.py
CHANGED
|
@@ -19,7 +19,7 @@ _eeg_miner_methods = ["mag", "corr", "plv"]
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class EEGMiner(EEGModuleMixin, nn.Module):
|
|
22
|
-
|
|
22
|
+
"""EEGMiner from Ludwig et al (2024) [eegminer]_.
|
|
23
23
|
|
|
24
24
|
:bdg-success:`Convolution` :bdg-warning:`Interpretability`
|
|
25
25
|
|
braindecode/models/eegnet.py
CHANGED
|
@@ -20,7 +20,7 @@ from braindecode.modules import (
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class EEGNet(EEGModuleMixin, nn.Sequential):
|
|
23
|
-
|
|
23
|
+
"""EEGNet model from Lawhern et al. (2018) [Lawhern2018]_.
|
|
24
24
|
|
|
25
25
|
:bdg-success:`Convolution`
|
|
26
26
|
|
|
@@ -143,7 +143,7 @@ class EEGNet(EEGModuleMixin, nn.Sequential):
|
|
|
143
143
|
pool1_kernel_size: int = 4,
|
|
144
144
|
pool2_kernel_size: int = 8,
|
|
145
145
|
conv_spatial_max_norm: int = 1,
|
|
146
|
-
activation:
|
|
146
|
+
activation: nn.Module = nn.ELU,
|
|
147
147
|
batch_norm_momentum: float = 0.01,
|
|
148
148
|
batch_norm_affine: bool = True,
|
|
149
149
|
batch_norm_eps: float = 1e-3,
|
|
@@ -354,6 +354,6 @@ class EEGNet(EEGModuleMixin, nn.Sequential):
|
|
|
354
354
|
"`EEGNetv4` was renamed to `EEGNet` in v1.12; this alias will be removed in v1.14."
|
|
355
355
|
)
|
|
356
356
|
class EEGNetv4(EEGNet):
|
|
357
|
-
|
|
357
|
+
"""Deprecated alias for EEGNet."""
|
|
358
358
|
|
|
359
359
|
pass
|
braindecode/models/eegnex.py
CHANGED
|
@@ -14,7 +14,7 @@ from braindecode.modules import Conv2dWithConstraint, LinearWithConstraint
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class EEGNeX(EEGModuleMixin, nn.Module):
|
|
17
|
-
|
|
17
|
+
"""EEGNeX model from Chen et al. (2024) [eegnex]_.
|
|
18
18
|
|
|
19
19
|
:bdg-success:`Convolution`
|
|
20
20
|
|
|
@@ -178,7 +178,7 @@ class EEGNeX(EEGModuleMixin, nn.Module):
|
|
|
178
178
|
input_window_seconds=None,
|
|
179
179
|
sfreq=None,
|
|
180
180
|
# Model parameters
|
|
181
|
-
activation:
|
|
181
|
+
activation: nn.Module = nn.ELU,
|
|
182
182
|
depth_multiplier: int = 2,
|
|
183
183
|
filter_1: int = 8,
|
|
184
184
|
filter_2: int = 32,
|
|
@@ -19,7 +19,7 @@ from braindecode.models.base import EEGModuleMixin
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class EEGSimpleConv(EEGModuleMixin, torch.nn.Module):
|
|
22
|
-
|
|
22
|
+
"""EEGSimpleConv from Ouahidi, YE et al. (2023) [Yassine2023]_.
|
|
23
23
|
|
|
24
24
|
:bdg-success:`Convolution`
|
|
25
25
|
|
|
@@ -107,7 +107,7 @@ class EEGSimpleConv(EEGModuleMixin, torch.nn.Module):
|
|
|
107
107
|
resampling_freq=80,
|
|
108
108
|
kernel_size=8,
|
|
109
109
|
return_feature=False,
|
|
110
|
-
activation:
|
|
110
|
+
activation: nn.Module = nn.ReLU,
|
|
111
111
|
# Other ways to initialize the model
|
|
112
112
|
chs_info=None,
|
|
113
113
|
n_times=None,
|
braindecode/models/eegsym.py
CHANGED
|
@@ -14,7 +14,7 @@ from braindecode.models.base import EEGModuleMixin
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class EEGSym(EEGModuleMixin, nn.Module):
|
|
17
|
-
|
|
17
|
+
"""EEGSym from Pérez-Velasco et al (2022) [eegsym2022]_.
|
|
18
18
|
|
|
19
19
|
:bdg-success:`Convolution` :bdg-dark-line:`Channel`
|
|
20
20
|
|
|
@@ -430,7 +430,7 @@ class EEGSym(EEGModuleMixin, nn.Module):
|
|
|
430
430
|
|
|
431
431
|
|
|
432
432
|
class _InceptionBlock(nn.Module):
|
|
433
|
-
|
|
433
|
+
"""Inception module used in EEGSym architecture.
|
|
434
434
|
|
|
435
435
|
Parameters
|
|
436
436
|
----------
|
|
@@ -543,7 +543,7 @@ class _InceptionBlock(nn.Module):
|
|
|
543
543
|
|
|
544
544
|
|
|
545
545
|
class _ResidualBlock(nn.Module):
|
|
546
|
-
|
|
546
|
+
"""Residual block used in EEGSym architecture.
|
|
547
547
|
|
|
548
548
|
Parameters
|
|
549
549
|
----------
|
|
@@ -652,7 +652,7 @@ class _ResidualBlock(nn.Module):
|
|
|
652
652
|
|
|
653
653
|
|
|
654
654
|
class _TemporalBlock(nn.Module):
|
|
655
|
-
|
|
655
|
+
"""Temporal reduction block used in EEGSym architecture.
|
|
656
656
|
|
|
657
657
|
Parameters
|
|
658
658
|
----------
|
|
@@ -706,7 +706,7 @@ class _TemporalBlock(nn.Module):
|
|
|
706
706
|
|
|
707
707
|
|
|
708
708
|
class _ChannelMergingBlock(nn.Module):
|
|
709
|
-
|
|
709
|
+
"""Channel merging block used in EEGSym architecture.
|
|
710
710
|
|
|
711
711
|
This block performs hemisphere merging through:
|
|
712
712
|
1. Two residual convolution iterations (with full spatial kernel)
|
|
@@ -791,7 +791,7 @@ class _ChannelMergingBlock(nn.Module):
|
|
|
791
791
|
|
|
792
792
|
|
|
793
793
|
class _TemporalMergingBlock(nn.Module):
|
|
794
|
-
|
|
794
|
+
"""Temporal merging block used in EEGSym architecture.
|
|
795
795
|
|
|
796
796
|
This block performs temporal dimension collapse through:
|
|
797
797
|
1. One residual convolution (temporal collapse with residual connection)
|
|
@@ -869,7 +869,7 @@ class _TemporalMergingBlock(nn.Module):
|
|
|
869
869
|
|
|
870
870
|
|
|
871
871
|
class _OutputBlock(nn.Module):
|
|
872
|
-
|
|
872
|
+
"""Output block used in EEGSym architecture.
|
|
873
873
|
|
|
874
874
|
Parameters
|
|
875
875
|
----------
|
braindecode/models/eegtcnet.py
CHANGED
|
@@ -13,7 +13,7 @@ from braindecode.modules import Chomp1d, MaxNormLinear
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class EEGTCNet(EEGModuleMixin, nn.Module):
|
|
16
|
-
|
|
16
|
+
"""EEGTCNet model from Ingolfsson et al. (2020) [ingolfsson2020]_.
|
|
17
17
|
|
|
18
18
|
:bdg-success:`Convolution` :bdg-secondary:`Recurrent`
|
|
19
19
|
|
|
@@ -63,7 +63,7 @@ class EEGTCNet(EEGModuleMixin, nn.Module):
|
|
|
63
63
|
input_window_seconds=None,
|
|
64
64
|
sfreq=None,
|
|
65
65
|
# Model parameters
|
|
66
|
-
activation:
|
|
66
|
+
activation: nn.Module = nn.ELU,
|
|
67
67
|
depth_multiplier: int = 2,
|
|
68
68
|
filter_1: int = 8,
|
|
69
69
|
kern_length: int = 64,
|
|
@@ -157,7 +157,7 @@ class EEGTCNet(EEGModuleMixin, nn.Module):
|
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
class _EEGNetTC(nn.Module):
|
|
160
|
-
|
|
160
|
+
"""EEGNet Temporal Convolutional Network (TCN) block.
|
|
161
161
|
|
|
162
162
|
The main difference from our :class:`EEGNet` (braindecode) implementation is the
|
|
163
163
|
kernel and dimensional order. Because of this, we decided to keep this
|
|
@@ -187,7 +187,7 @@ class _EEGNetTC(nn.Module):
|
|
|
187
187
|
kern_length: int = 64,
|
|
188
188
|
depth_multiplier: int = 2,
|
|
189
189
|
drop_prob: float = 0.5,
|
|
190
|
-
activation:
|
|
190
|
+
activation: nn.Module = nn.ELU,
|
|
191
191
|
):
|
|
192
192
|
super().__init__()
|
|
193
193
|
self.activation = activation()
|
|
@@ -260,7 +260,7 @@ class _EEGNetTC(nn.Module):
|
|
|
260
260
|
|
|
261
261
|
|
|
262
262
|
class _TCNBlock(nn.Module):
|
|
263
|
-
|
|
263
|
+
"""
|
|
264
264
|
Many differences from our Temporal Block (braindecode) implementation.
|
|
265
265
|
Because of this, we decided to keep this implementation in a future issue;
|
|
266
266
|
we will re-evaluate if it is necessary to maintain this separate
|
|
@@ -276,7 +276,7 @@ class _TCNBlock(nn.Module):
|
|
|
276
276
|
kernel_size: int,
|
|
277
277
|
filters: int,
|
|
278
278
|
drop_prob: float,
|
|
279
|
-
activation:
|
|
279
|
+
activation: nn.Module = nn.ELU,
|
|
280
280
|
):
|
|
281
281
|
super().__init__()
|
|
282
282
|
self.activation = activation()
|
braindecode/models/fbcnet.py
CHANGED
|
@@ -29,7 +29,7 @@ _valid_layers = {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class FBCNet(EEGModuleMixin, nn.Module):
|
|
32
|
-
|
|
32
|
+
"""FBCNet from Mane, R et al (2021) [fbcnet2021]_.
|
|
33
33
|
|
|
34
34
|
:bdg-success:`Convolution` :bdg-primary:`Filterbank`
|
|
35
35
|
|
|
@@ -97,7 +97,7 @@ class FBCNet(EEGModuleMixin, nn.Module):
|
|
|
97
97
|
temporal_layer: str = "LogVarLayer",
|
|
98
98
|
n_dim: int = 3,
|
|
99
99
|
stride_factor: int = 4,
|
|
100
|
-
activation:
|
|
100
|
+
activation: nn.Module = nn.SiLU,
|
|
101
101
|
linear_max_norm: float = 0.5,
|
|
102
102
|
cnn_max_norm: float = 2.0,
|
|
103
103
|
filter_parameters: dict[Any, Any] | None = None,
|
|
@@ -16,7 +16,7 @@ from braindecode.modules import (
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class FBLightConvNet(EEGModuleMixin, nn.Module):
|
|
19
|
-
|
|
19
|
+
"""LightConvNet from Ma, X et al (2023) [lightconvnet]_.
|
|
20
20
|
|
|
21
21
|
:bdg-success:`Convolution` :bdg-primary:`Filterbank`
|
|
22
22
|
|
|
@@ -111,7 +111,7 @@ class FBLightConvNet(EEGModuleMixin, nn.Module):
|
|
|
111
111
|
heads: int = 8,
|
|
112
112
|
weight_softmax: bool = True,
|
|
113
113
|
bias: bool = False,
|
|
114
|
-
activation:
|
|
114
|
+
activation: nn.Module = nn.ELU,
|
|
115
115
|
verbose: bool = False,
|
|
116
116
|
filter_parameters: Optional[dict] = None,
|
|
117
117
|
):
|
|
@@ -235,7 +235,7 @@ class FBLightConvNet(EEGModuleMixin, nn.Module):
|
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
class _LightweightConv1d(nn.Module):
|
|
238
|
-
|
|
238
|
+
"""Lightweight 1D Convolution Module.
|
|
239
239
|
|
|
240
240
|
Applies a convolution operation with multiple heads, allowing for
|
|
241
241
|
parallel filter applications. Optionally applies a softmax normalization
|
braindecode/models/fbmsnet.py
CHANGED
|
@@ -17,7 +17,7 @@ from braindecode.modules import (
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class FBMSNet(EEGModuleMixin, nn.Module):
|
|
20
|
-
|
|
20
|
+
"""FBMSNet from Liu et al (2022) [fbmsnet]_.
|
|
21
21
|
|
|
22
22
|
:bdg-success:`Convolution` :bdg-primary:`Filterbank`
|
|
23
23
|
|
|
@@ -110,7 +110,7 @@ class FBMSNet(EEGModuleMixin, nn.Module):
|
|
|
110
110
|
n_dim: int = 3,
|
|
111
111
|
stride_factor: int = 4,
|
|
112
112
|
dilatability: int = 8,
|
|
113
|
-
activation:
|
|
113
|
+
activation: nn.Module = nn.SiLU,
|
|
114
114
|
kernels_weights: Sequence[int] = (15, 31, 63, 125),
|
|
115
115
|
cnn_max_norm: float = 2,
|
|
116
116
|
linear_max_norm: float = 0.5,
|
|
@@ -262,7 +262,7 @@ class FBMSNet(EEGModuleMixin, nn.Module):
|
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
class _MixedConv2d(nn.Module):
|
|
265
|
-
|
|
265
|
+
"""Mixed Grouped Convolution for multiscale feature extraction."""
|
|
266
266
|
|
|
267
267
|
def __init__(
|
|
268
268
|
self,
|
braindecode/models/hybrid.py
CHANGED
|
@@ -11,7 +11,7 @@ from braindecode.models.shallow_fbcsp import ShallowFBCSPNet
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class HybridNet(nn.Module):
|
|
14
|
-
|
|
14
|
+
"""Hybrid ConvNet model from Schirrmeister, R T et al (2017) [Schirrmeister2017]_.
|
|
15
15
|
|
|
16
16
|
See [Schirrmeister2017]_ for details.
|
|
17
17
|
|
|
@@ -34,7 +34,7 @@ class HybridNet(nn.Module):
|
|
|
34
34
|
input_window_seconds=None,
|
|
35
35
|
sfreq=None,
|
|
36
36
|
chs_info=None,
|
|
37
|
-
activation:
|
|
37
|
+
activation: nn.Module = nn.ELU,
|
|
38
38
|
drop_prob: float = 0.5,
|
|
39
39
|
):
|
|
40
40
|
super().__init__()
|
braindecode/models/ifnet.py
CHANGED
|
@@ -29,7 +29,7 @@ from braindecode.modules import (
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class IFNet(EEGModuleMixin, nn.Module):
|
|
32
|
-
|
|
32
|
+
"""IFNetV2 from Wang J et al (2023) [ifnet]_.
|
|
33
33
|
|
|
34
34
|
:bdg-success:`Convolution` :bdg-primary:`Filterbank`
|
|
35
35
|
|
|
@@ -238,9 +238,9 @@ class IFNet(EEGModuleMixin, nn.Module):
|
|
|
238
238
|
|
|
239
239
|
|
|
240
240
|
class _InterFrequencyModule(nn.Module):
|
|
241
|
-
|
|
241
|
+
"""Module that combines outputs from different frequency bands."""
|
|
242
242
|
|
|
243
|
-
def __init__(self, activation:
|
|
243
|
+
def __init__(self, activation: nn.Module = nn.GELU):
|
|
244
244
|
"""
|
|
245
245
|
|
|
246
246
|
Parameters
|
|
@@ -272,7 +272,7 @@ class _InterFrequencyModule(nn.Module):
|
|
|
272
272
|
|
|
273
273
|
|
|
274
274
|
class _SpatioTemporalFeatureBlock(nn.Module):
|
|
275
|
-
|
|
275
|
+
"""SpatioTemporal Feature Block consisting of spatial and temporal convolutions."""
|
|
276
276
|
|
|
277
277
|
def __init__(
|
|
278
278
|
self,
|
|
@@ -283,7 +283,7 @@ class _SpatioTemporalFeatureBlock(nn.Module):
|
|
|
283
283
|
stride_factor: int = 8,
|
|
284
284
|
n_bands: int = 2,
|
|
285
285
|
drop_prob: float = 0.5,
|
|
286
|
-
activation:
|
|
286
|
+
activation: nn.Module = nn.GELU,
|
|
287
287
|
dim: int = 3,
|
|
288
288
|
):
|
|
289
289
|
"""
|