braindecode 1.2.0.dev168908090__tar.gz → 1.2.0.dev175337561__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.

Potentially problematic release.


This version of braindecode might be problematic. Click here for more details.

Files changed (122) hide show
  1. {braindecode-1.2.0.dev168908090/braindecode.egg-info → braindecode-1.2.0.dev175337561}/PKG-INFO +1 -1
  2. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/attentionbasenet.py +140 -18
  3. braindecode-1.2.0.dev175337561/braindecode/version.py +1 -0
  4. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561/braindecode.egg-info}/PKG-INFO +1 -1
  5. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/whats_new.rst +1 -0
  6. braindecode-1.2.0.dev168908090/braindecode/version.py +0 -1
  7. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/LICENSE.txt +0 -0
  8. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/MANIFEST.in +0 -0
  9. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/NOTICE.txt +0 -0
  10. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/README.rst +0 -0
  11. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/__init__.py +0 -0
  12. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/augmentation/__init__.py +0 -0
  13. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/augmentation/base.py +0 -0
  14. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/augmentation/functional.py +0 -0
  15. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/augmentation/transforms.py +0 -0
  16. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/classifier.py +0 -0
  17. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/__init__.py +0 -0
  18. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/base.py +0 -0
  19. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/bbci.py +0 -0
  20. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/bcicomp.py +0 -0
  21. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/bids.py +0 -0
  22. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/mne.py +0 -0
  23. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/moabb.py +0 -0
  24. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/nmt.py +0 -0
  25. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
  26. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/sleep_physionet.py +0 -0
  27. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/tuh.py +0 -0
  28. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datasets/xy.py +0 -0
  29. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datautil/__init__.py +0 -0
  30. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datautil/serialization.py +0 -0
  31. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/datautil/util.py +0 -0
  32. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/eegneuralnet.py +0 -0
  33. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/functional/__init__.py +0 -0
  34. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/functional/functions.py +0 -0
  35. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/functional/initialization.py +0 -0
  36. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/__init__.py +0 -0
  37. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/atcnet.py +0 -0
  38. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/base.py +0 -0
  39. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/biot.py +0 -0
  40. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/contrawr.py +0 -0
  41. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/ctnet.py +0 -0
  42. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/deep4.py +0 -0
  43. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/deepsleepnet.py +0 -0
  44. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegconformer.py +0 -0
  45. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eeginception_erp.py +0 -0
  46. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eeginception_mi.py +0 -0
  47. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegitnet.py +0 -0
  48. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegminer.py +0 -0
  49. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegnet.py +0 -0
  50. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegnex.py +0 -0
  51. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegresnet.py +0 -0
  52. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegsimpleconv.py +0 -0
  53. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/eegtcnet.py +0 -0
  54. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/fbcnet.py +0 -0
  55. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/fblightconvnet.py +0 -0
  56. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/fbmsnet.py +0 -0
  57. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/hybrid.py +0 -0
  58. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/ifnet.py +0 -0
  59. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/labram.py +0 -0
  60. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/msvtnet.py +0 -0
  61. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sccnet.py +0 -0
  62. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/shallow_fbcsp.py +0 -0
  63. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/signal_jepa.py +0 -0
  64. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sinc_shallow.py +0 -0
  65. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
  66. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
  67. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sleep_stager_eldele_2021.py +0 -0
  68. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/sparcnet.py +0 -0
  69. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/summary.csv +0 -0
  70. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/syncnet.py +0 -0
  71. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/tcn.py +0 -0
  72. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/tidnet.py +0 -0
  73. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/tsinception.py +0 -0
  74. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/usleep.py +0 -0
  75. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/models/util.py +0 -0
  76. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/__init__.py +0 -0
  77. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/activation.py +0 -0
  78. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/attention.py +0 -0
  79. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/blocks.py +0 -0
  80. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/convolution.py +0 -0
  81. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/filter.py +0 -0
  82. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/layers.py +0 -0
  83. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/linear.py +0 -0
  84. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/parametrization.py +0 -0
  85. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/stats.py +0 -0
  86. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/util.py +0 -0
  87. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/modules/wrapper.py +0 -0
  88. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/preprocessing/__init__.py +0 -0
  89. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/preprocessing/mne_preprocess.py +0 -0
  90. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/preprocessing/preprocess.py +0 -0
  91. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/preprocessing/windowers.py +0 -0
  92. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/regressor.py +0 -0
  93. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/samplers/__init__.py +0 -0
  94. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/samplers/base.py +0 -0
  95. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/samplers/ssl.py +0 -0
  96. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/training/__init__.py +0 -0
  97. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/training/callbacks.py +0 -0
  98. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/training/losses.py +0 -0
  99. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/training/scoring.py +0 -0
  100. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/util.py +0 -0
  101. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/visualization/__init__.py +0 -0
  102. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/visualization/confusion_matrices.py +0 -0
  103. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode/visualization/gradients.py +0 -0
  104. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode.egg-info/SOURCES.txt +0 -0
  105. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode.egg-info/dependency_links.txt +0 -0
  106. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode.egg-info/requires.txt +0 -0
  107. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/braindecode.egg-info/top_level.txt +0 -0
  108. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/Makefile +0 -0
  109. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/_templates/autosummary/class.rst +0 -0
  110. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/_templates/autosummary/function.rst +0 -0
  111. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/api.rst +0 -0
  112. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/cite.rst +0 -0
  113. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/conf.py +0 -0
  114. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/help.rst +0 -0
  115. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/index.rst +0 -0
  116. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/install/install.rst +0 -0
  117. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/install/install_pip.rst +0 -0
  118. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/install/install_source.rst +0 -0
  119. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/models_summary.rst +0 -0
  120. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/docs/sg_execution_times.rst +0 -0
  121. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/pyproject.toml +0 -0
  122. {braindecode-1.2.0.dev168908090 → braindecode-1.2.0.dev175337561}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.2.0.dev168908090
3
+ Version: 1.2.0.dev175337561
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>
@@ -24,26 +24,148 @@ from braindecode.modules.attention import (
24
24
 
25
25
 
26
26
  class AttentionBaseNet(EEGModuleMixin, nn.Module):
27
- """AttentionBaseNet from Wimpff M et al. (2023) [Martin2023]_.
27
+ """
28
+
29
+ :bdg-success:`Convolution` :bdg-info:`Small Attention`
28
30
 
29
31
  .. figure:: https://content.cld.iop.org/journals/1741-2552/21/3/036020/revision2/jnead48b9f2_hr.jpg
30
- :align: center
31
- :alt: Attention Base Net
32
-
33
- Neural Network from the paper: EEG motor imagery decoding:
34
- A framework for comparative analysis with channel attention
35
- mechanisms
36
-
37
- The paper and original code with more details about the methodological
38
- choices are available at the [Martin2023]_ and [MartinCode]_.
39
-
40
- The AttentionBaseNet architecture is composed of four modules:
41
- - Input Block that performs a temporal convolution and a spatial
42
- convolution.
43
- - Channel Expansion that modifies the number of channels.
44
- - An attention block that performs channel attention with several
45
- options
46
- - ClassificationHead
32
+ :align: center
33
+ :alt: AttentionBaseNet Architecture
34
+ :width: 640px
35
+
36
+
37
+ .. rubric:: Architectural Overview
38
+
39
+ AttentionBaseNet is a *convolution-first* network with a *channel-attention* stage.
40
+ The end-to-end flow is:
41
+
42
+ - (i) :class:`_FeatureExtractor` learns a temporal filter bank and per-filter spatial
43
+ projections (depthwise across electrodes), then condenses time by pooling;
44
+ - (ii) **Channel Expansion** uses a ``1x1`` convolution to set the feature width;
45
+ - (iii) :class:`_ChannelAttentionBlock` refines features via depthwise–pointwise temporal
46
+ convs and an optional channel-attention module (SE/CBAM/ECA/…);
47
+ - (iv) **Classifier** flattens the sequence and applies a linear readout.
48
+
49
+ This design mirrors shallow CNN pipelines (EEGNet-style stem) but inserts a pluggable
50
+ attention unit that *re-weights channels* (and optionally temporal positions) before
51
+ classification.
52
+
53
+
54
+ .. rubric:: Macro Components
55
+
56
+ - :class:`_FeatureExtractor` **(Shallow conv stem → condensed feature map)**
57
+
58
+ - *Operations.*
59
+ - **Temporal conv** (:class:`torch.nn.Conv2d`) with kernel ``(1, L_t)`` creates a learned
60
+ FIR-like filter bank with ``n_temporal_filters`` maps.
61
+ - **Depthwise spatial conv** (:class:`torch.nn.Conv2d`, ``groups=n_temporal_filters``)
62
+ with kernel ``(n_chans, 1)`` learns per-filter spatial projections over the full montage.
63
+ - **BatchNorm → ELU → AvgPool → Dropout** stabilize and downsample time.
64
+ - Output shape: ``(B, F2, 1, T₁)`` with ``F2 = n_temporal_filters x spatial_expansion``.
65
+
66
+ *Interpretability/robustness.* Temporal kernels behave as analyzable FIR filters; the
67
+ depthwise spatial step yields rhythm-specific topographies. Pooling acts as a local
68
+ integrator that reduces variance on short EEG windows.
69
+
70
+ - **Channel Expansion**
71
+
72
+ - *Operations.*
73
+ - A ``1x1`` conv → BN → activation maps ``F2 → ch_dim`` without changing
74
+ the temporal length ``T₁`` (shape: ``(B, ch_dim, 1, T₁)``).
75
+ This sets the embedding width for the attention block.
76
+
77
+ - :class:`_ChannelAttentionBlock` **(temporal refinement + channel attention)**
78
+
79
+ - *Operations.*
80
+ - **Depthwise temporal conv** ``(1, L_a)`` (groups=``ch_dim``) + **pointwise ``1x1``**,
81
+ BN and activation → preserves shape ``(B, ch_dim, 1, T₁)`` while refining timing.
82
+ - **Optional attention module** (see *Additional Mechanisms*) applies channel reweighting
83
+ (some variants also apply temporal gating).
84
+ - **AvgPool (1, P₂)** with stride ``(1, S₂)`` and **Dropout** → outputs
85
+ ``(B, ch_dim, 1, T₂)``.
86
+
87
+ *Role.* Emphasizes informative channels (and, in certain modes, salient time steps)
88
+ before the classifier; complements the convolutional priors with adaptive re-weighting.
89
+
90
+ - **Classifier (aggregation + readout)**
91
+
92
+ *Operations.* :class:`torch.nn.Flatten` → :class:`torch.nn.Linear` from
93
+ ``(B, ch_dim·T₂)`` to classes.
94
+
95
+
96
+ .. rubric:: Convolutional Details
97
+
98
+ - **Temporal (where time-domain patterns are learned).**
99
+ Wide kernels in the stem (``(1, L_t)``) act as a learned filter bank for oscillatory
100
+ bands/transients; the attention block’s depthwise temporal conv (``(1, L_a)``) sharpens
101
+ short-term dynamics after downsampling. Pool sizes/strides (``P₁,S₁`` then ``P₂,S₂``)
102
+ set the token rate and effective temporal resolution.
103
+
104
+ - **Spatial (how electrodes are processed).**
105
+ A depthwise spatial conv with kernel ``(n_chans, 1)`` spans the full montage to
106
+ learn *per-temporal-filter* spatial projections (no cross-filter mixing at this step),
107
+ mirroring the interpretable spatial stage in shallow CNNs.
108
+
109
+ - **Spectral (how frequency content is captured).**
110
+ No explicit Fourier/wavelet transform is used in the stem—spectral selectivity
111
+ emerges from learned temporal kernels. When ``attention_mode="fca"``, a frequency
112
+ channel attention (DCT-based) summarizes frequencies to drive channel weights.
113
+
114
+
115
+ .. rubric:: Attention / Sequential Modules
116
+
117
+ - **Type.** Channel attention chosen by ``attention_mode`` (SE, ECA, CBAM, CAT, GSoP,
118
+ EncNet, GE, GCT, SRM, CATLite). Most operate purely on channels; CBAM/CAT additionally
119
+ include temporal attention.
120
+ - **Shapes.** Input/Output around attention: ``(B, ch_dim, 1, T₁)``. Re-arrangements
121
+ (if any) are internal to the module; the block returns the same shape before pooling.
122
+ - **Role.** Re-weights channels (and optionally time) to highlight informative sources
123
+ and suppress distractors, improving SNR ahead of the linear head.
124
+
125
+
126
+ .. rubric:: Additional Mechanisms
127
+
128
+ - **Attention variants at a glance.**
129
+ - ``"se"``: Squeeze-and-Excitation (global pooling → bottleneck → gates).
130
+ - ``"gsop"``: Global second-order pooling (covariance-aware channel weights).
131
+ - ``"fca"``: Frequency Channel Attention (DCT summary; uses ``seq_len`` and ``freq_idx``).
132
+ - ``"encnet"``: EncNet with learned codewords (uses ``n_codewords``).
133
+ - ``"eca"``: Efficient Channel Attention (local 1-D conv over channel descriptor; uses ``kernel_size``).
134
+ - ``"ge"``: Gather–Excite (context pooling with optional MLP; can use ``extra_params``).
135
+ - ``"gct"``: Gated Channel Transformation (global context normalization + gating).
136
+ - ``"srm"``: Style-based recalibration (mean–std descriptors; optional MLP).
137
+ - ``"cbam"``: Channel then temporal attention (uses ``kernel_size``).
138
+ - ``"cat"`` / ``"catlite"``: Collaborative (channel ± temporal) attention; *lite* omits temporal.
139
+ - **Auto-compatibility on short inputs.**
140
+
141
+ If the input duration is too short for the configured kernels/pools, the implementation
142
+ **automatically rescales** temporal lengths/strides downward (with a warning) to keep
143
+ shapes valid and preserve the pipeline semantics.
144
+
145
+
146
+ .. rubric:: Usage and Configuration
147
+
148
+ - ``n_temporal_filters``, ``temporal_filter_length`` and ``spatial_expansion``:
149
+ control the capacity and the number of spatial projections in the stem.
150
+ - ``pool_length_inp``, ``pool_stride_inp`` then ``pool_length``, ``pool_stride``:
151
+ trade temporal resolution for compute; they determine the final sequence length ``T₂``.
152
+ - ``ch_dim``: width after the ``1x1`` expansion and the effective embedding size for attention.
153
+ - ``attention_mode`` + its specific hyperparameters (``reduction_rate``,
154
+ ``kernel_size``, ``seq_len``, ``freq_idx``, ``n_codewords``, ``use_mlp``):
155
+ select and tune the reweighting mechanism.
156
+ - ``drop_prob_inp`` and ``drop_prob_attn``: regularize stem and attention stages.
157
+ - **Training tips.**
158
+
159
+ Start with moderate pooling (e.g., ``P₁=75,S₁=15``) and ELU activations; enable attention
160
+ only after the stem learns stable filters. For small datasets, prefer simpler modes
161
+ (``"se"``, ``"eca"``) before heavier ones (``"gsop"``, ``"encnet"``).
162
+
163
+ Notes
164
+ -----
165
+ - Sequence length after each stage is computed internally; the final classifier expects
166
+ a flattened ``ch_dim x T₂`` vector.
167
+ - Attention operates on *channel* dimension by design; temporal gating exists only in
168
+ specific variants (CBAM/CAT).
47
169
 
48
170
  .. versionadded:: 0.9
49
171
 
@@ -0,0 +1 @@
1
+ __version__ = "1.2.0.dev175337561"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.2.0.dev168908090
3
+ Version: 1.2.0.dev175337561
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>
@@ -25,6 +25,7 @@ Enhancements
25
25
  - Improving the docstring for :class:`braindecode.models.EEGNetv4` (:gh:`768` by `Bruno Aristimunha`_)
26
26
  - Improving the docstring for :class:`braindecode.models.EEGConformer` (:gh:`769` by `Bruno Aristimunha`_)
27
27
  - Improving the docstring for :class:`braindecode.models.ATCNet` (:gh:`771` by `Bruno Aristimunha`_)
28
+ - Improving the docstring for :class:`braindecode.models.AttentionBaseNet` (:gh:`772` by `Bruno Aristimunha`_)
28
29
 
29
30
 
30
31
  API changes
@@ -1 +0,0 @@
1
- __version__ = "1.2.0.dev168908090"