braindecode 2.1.0.dev4294968710__tar.gz → 2.1.0.dev4294968711__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.
Files changed (236) hide show
  1. {braindecode-2.1.0.dev4294968710/braindecode.egg-info → braindecode-2.1.0.dev4294968711}/PKG-INFO +1 -1
  2. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/bbl.py +54 -31
  3. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/corteg.py +75 -39
  4. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/meggpt.py +48 -21
  5. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/nice.py +3 -0
  6. braindecode-2.1.0.dev4294968711/braindecode/version.py +1 -0
  7. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711/braindecode.egg-info}/PKG-INFO +1 -1
  8. braindecode-2.1.0.dev4294968710/braindecode/version.py +0 -1
  9. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/LICENSE.txt +0 -0
  10. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/MANIFEST.in +0 -0
  11. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/NOTICE.txt +0 -0
  12. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/README.rst +0 -0
  13. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/__init__.py +0 -0
  14. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/augmentation/__init__.py +0 -0
  15. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/augmentation/base.py +0 -0
  16. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/augmentation/functional.py +0 -0
  17. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/augmentation/transforms.py +0 -0
  18. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/classifier.py +0 -0
  19. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/__init__.py +0 -0
  20. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/_notebook_viewer.py +0 -0
  21. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/base.py +0 -0
  22. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bbci.py +0 -0
  23. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bcicomp.py +0 -0
  24. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/__init__.py +0 -0
  25. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/datasets.py +0 -0
  26. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/hub.py +0 -0
  27. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/hub_format.py +0 -0
  28. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/hub_io.py +0 -0
  29. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/hub_validation.py +0 -0
  30. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/bids/iterable.py +0 -0
  31. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/chb_mit.py +0 -0
  32. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/collate.py +0 -0
  33. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/mne.py +0 -0
  34. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/moabb.py +0 -0
  35. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/nmt.py +0 -0
  36. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/registry.py +0 -0
  37. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/siena.py +0 -0
  38. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
  39. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/sleep_physionet.py +0 -0
  40. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/tuh.py +0 -0
  41. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/utils.py +0 -0
  42. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datasets/xy.py +0 -0
  43. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datautil/__init__.py +0 -0
  44. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datautil/channel_utils.py +0 -0
  45. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datautil/hub_formats.py +0 -0
  46. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datautil/serialization.py +0 -0
  47. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/datautil/util.py +0 -0
  48. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/eegneuralnet.py +0 -0
  49. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/__init__.py +0 -0
  50. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/_lfilter.py +0 -0
  51. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/_real_dft.py +0 -0
  52. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/attention.py +0 -0
  53. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/channel_mask.py +0 -0
  54. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/channels.py +0 -0
  55. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/functions.py +0 -0
  56. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/initialization.py +0 -0
  57. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/functional/patches.py +0 -0
  58. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/__init__.py +0 -0
  59. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/atcnet.py +0 -0
  60. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/attentionbasenet.py +0 -0
  61. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/attn_sleep.py +0 -0
  62. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/axon.py +0 -0
  63. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/barista.py +0 -0
  64. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/base.py +0 -0
  65. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/bendr.py +0 -0
  66. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/biot.py +0 -0
  67. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/brainbert.py +0 -0
  68. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/brainmodule.py +0 -0
  69. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/brainomni.py +0 -0
  70. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/brant.py +0 -0
  71. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/caresleepnet.py +0 -0
  72. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/cbramod.py +0 -0
  73. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/codebrain.py +0 -0
  74. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/config.py +0 -0
  75. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/contrawr.py +0 -0
  76. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/csbrain.py +0 -0
  77. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/ctnet.py +0 -0
  78. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/dance.py +0 -0
  79. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/deep4.py +0 -0
  80. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/deepsleepnet.py +0 -0
  81. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/dgcnn.py +0 -0
  82. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/diver1.py +0 -0
  83. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/duin.py +0 -0
  84. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eeg_clip.py +0 -0
  85. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegconformer.py +0 -0
  86. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegdino.py +0 -0
  87. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eeginception_erp.py +0 -0
  88. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eeginception_mi.py +0 -0
  89. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegitnet.py +0 -0
  90. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegminer.py +0 -0
  91. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegnet.py +0 -0
  92. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegnex.py +0 -0
  93. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegpt.py +0 -0
  94. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegsimpleconv.py +0 -0
  95. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegsym.py +0 -0
  96. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/eegtcnet.py +0 -0
  97. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/emg2qwerty.py +0 -0
  98. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/epint.py +0 -0
  99. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fbcnet.py +0 -0
  100. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fblightconvnet.py +0 -0
  101. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fbmsnet.py +0 -0
  102. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fnirs4d.py +0 -0
  103. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fnirs_cnn1d.py +0 -0
  104. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fnirs_t.py +0 -0
  105. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/fnirsnet.py +0 -0
  106. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/gcnsnet.py +0 -0
  107. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/geonirs.py +0 -0
  108. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/guetschel2026.py +0 -0
  109. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/hybrid.py +0 -0
  110. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/ifnet.py +0 -0
  111. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/jung_mae.py +0 -0
  112. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/labram.py +0 -0
  113. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/luna.py +0 -0
  114. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/mapa.py +0 -0
  115. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/medformer.py +0 -0
  116. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/megxl.py +0 -0
  117. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/meta_neuromotor.py +0 -0
  118. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/mirepnet.py +0 -0
  119. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/model.html.jinja +0 -0
  120. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/mscformer.py +0 -0
  121. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/msvtnet.py +0 -0
  122. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/mtrenirs.py +0 -0
  123. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/mvpformer.py +0 -0
  124. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/neuropose.py +0 -0
  125. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/neurorvq.py +0 -0
  126. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/neurorvq_tokenizer.py +0 -0
  127. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/patchedtransformer.py +0 -0
  128. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/popt.py +0 -0
  129. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/pratibha2.py +0 -0
  130. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/reve.py +0 -0
  131. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/samba.py +0 -0
  132. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sccnet.py +0 -0
  133. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/seizure_transformer.py +0 -0
  134. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sensingdynamics.py +0 -0
  135. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/shallow_fbcsp.py +0 -0
  136. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/signal_jepa.py +0 -0
  137. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sinc_shallow.py +0 -0
  138. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
  139. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
  140. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sleepfm.py +0 -0
  141. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sparcnet.py +0 -0
  142. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/sstdpn.py +0 -0
  143. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/steegformer.py +0 -0
  144. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/summary.csv +0 -0
  145. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/syncnet.py +0 -0
  146. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tccnet.py +0 -0
  147. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tcformer.py +0 -0
  148. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tcn.py +0 -0
  149. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tfm_tokenizer.py +0 -0
  150. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tidnet.py +0 -0
  151. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tinymyo.py +0 -0
  152. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tmsanet.py +0 -0
  153. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/tsinception.py +0 -0
  154. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/usleep.py +0 -0
  155. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/util.py +0 -0
  156. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/vemg2pose.py +0 -0
  157. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/models/zuna.py +0 -0
  158. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/__init__.py +0 -0
  159. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/activation.py +0 -0
  160. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/attention.py +0 -0
  161. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/blocks.py +0 -0
  162. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/channels.py +0 -0
  163. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/convolution.py +0 -0
  164. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/dance_modules.py +0 -0
  165. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/filter.py +0 -0
  166. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/layers.py +0 -0
  167. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/linear.py +0 -0
  168. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/linear_attention.py +0 -0
  169. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/parametrization.py +0 -0
  170. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/quantization.py +0 -0
  171. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/seanet.py +0 -0
  172. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/spatial_temporal.py +0 -0
  173. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/stats.py +0 -0
  174. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/util.py +0 -0
  175. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/modules/wrapper.py +0 -0
  176. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/__init__.py +0 -0
  177. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
  178. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/mne_preprocess.py +0 -0
  179. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/preprocess.py +0 -0
  180. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/util.py +0 -0
  181. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/preprocessing/windowers.py +0 -0
  182. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/regressor.py +0 -0
  183. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/samplers/__init__.py +0 -0
  184. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/samplers/base.py +0 -0
  185. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/samplers/ssl.py +0 -0
  186. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/training/__init__.py +0 -0
  187. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/training/_trial_aggregation.py +0 -0
  188. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/training/callbacks.py +0 -0
  189. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/training/losses.py +0 -0
  190. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/training/scoring.py +0 -0
  191. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/util.py +0 -0
  192. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/__init__.py +0 -0
  193. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/activations.py +0 -0
  194. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/attribution.py +0 -0
  195. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/confusion_matrices.py +0 -0
  196. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/frequency.py +0 -0
  197. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/metrics.py +0 -0
  198. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/sanity.py +0 -0
  199. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode/visualization/topology.py +0 -0
  200. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode.egg-info/SOURCES.txt +0 -0
  201. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode.egg-info/dependency_links.txt +0 -0
  202. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode.egg-info/requires.txt +0 -0
  203. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/braindecode.egg-info/top_level.txt +0 -0
  204. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/Makefile +0 -0
  205. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/_templates/autosummary/class.rst +0 -0
  206. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
  207. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/_templates/autosummary/function.rst +0 -0
  208. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
  209. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/agent_docs.rst +0 -0
  210. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/api.rst +0 -0
  211. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/cite.rst +0 -0
  212. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/conf.py +0 -0
  213. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/help.rst +0 -0
  214. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/index.rst +0 -0
  215. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/install/gaudi.rst +0 -0
  216. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/install/install.rst +0 -0
  217. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/install/install_pip.rst +0 -0
  218. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/install/install_source.rst +0 -0
  219. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/attention.rst +0 -0
  220. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/channel.rst +0 -0
  221. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/convolution.rst +0 -0
  222. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/filterbank.rst +0 -0
  223. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/gnn.rst +0 -0
  224. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/interpretable.rst +0 -0
  225. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/lbm.rst +0 -0
  226. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/recurrent.rst +0 -0
  227. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/categorization/spd.rst +0 -0
  228. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/channel_strategies.rst +0 -0
  229. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/models.rst +0 -0
  230. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/models_categorization.rst +0 -0
  231. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/models_table.rst +0 -0
  232. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/models/models_visualization.rst +0 -0
  233. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/sg_execution_times.rst +0 -0
  234. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/docs/whats_new.rst +0 -0
  235. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/pyproject.toml +0 -0
  236. {braindecode-2.1.0.dev4294968710 → braindecode-2.1.0.dev4294968711}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 2.1.0.dev4294968710
3
+ Version: 2.1.0.dev4294968711
4
4
  Summary: Deep learning software to decode EEG, ECG or MEG signals
5
5
  Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Alexandre Gramfort <agramfort@meta.com>
6
6
  Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
@@ -20,18 +20,33 @@ from braindecode.modules import SEANetEncoder
20
20
 
21
21
 
22
22
  class BBL(EEGModuleMixin, nn.Module, license="mit"):
23
- r"""BBL, the MEG encoder of *The Brain's Bitter Lesson* from Jayalath et al. (2025) [bbl]_.
23
+ r"""BBL from Jayalath et al. (2025) [bbl]_.
24
24
 
25
25
  :bdg-danger:`Foundation Model` :bdg-success:`Convolution` :bdg-secondary:`Recurrent`
26
26
 
27
+ .. versionadded:: 2.1
28
+
29
+ BBL is the MEG encoder of *The Brain's Bitter Lesson*, a self-supervised
30
+ representation for speech decoding from MEG. It is pretrained on CamCAN with
31
+ three pretext tasks (band, phase and amplitude). The implementation follows
32
+ the authors' code, ``neural-processing-lab/the-brains-bitter-lesson`` at
33
+ commit ``3965a2be``.
34
+
27
35
  .. rubric:: Architecture Overview
28
36
 
29
37
  A dataset-conditional convolutional projector, an EnCodec SEANet encoder
30
- averaged over time, and a learned subject embedding feed a linear head::
31
-
32
- (batch, n_chans, n_times) -> zero-pad to n_sensors -> projector ->
33
- dataset gate -> SEANetEncoder -> mean over time -> concat subject
34
- embedding -> (batch, n_outputs)
38
+ averaged over time, and a learned subject embedding feed a linear head. With
39
+ ``B`` the batch, ``C = n_chans``, ``T = n_times``,
40
+ ``T' = ceil(T / downsample_stride)`` and ``T'' = ceil(T' / prod(ratios))``::
41
+
42
+ x (B, C, T)
43
+ -> zero-pad to n_sensors (B, n_sensors, T)
44
+ -> projector (B, n_datasets * model_dim, T')
45
+ -> dataset gate (B, model_dim, T')
46
+ -> SEANetEncoder (B, model_dim, T'')
47
+ -> mean over time (B, model_dim)
48
+ -> concat subject embedding (B, model_dim + subject_dim)
49
+ -> final_layer (B, n_outputs)
35
50
 
36
51
  .. rubric:: Macro Components
37
52
 
@@ -49,11 +64,14 @@ class BBL(EEGModuleMixin, nn.Module, license="mit"):
49
64
 
50
65
  ``BBL.subject_embedding``
51
66
  **Operations.** ``Embedding(n_subjects, subject_dim)`` concatenated to
52
- the pooled features.
67
+ the pooled features. **Role.** Subject conditioning: one learned vector
68
+ per subject, so that the head can account for what varies between
69
+ subjects (Section 3.1 of the paper).
53
70
 
54
71
  ``BBL.final_layer``
55
72
  **Operations.** ``Linear(model_dim + subject_dim, n_outputs)``, the
56
- paper's linear probe.
73
+ paper's linear probe. **Role.** The task head, as in the authors'
74
+ ``Prober``; it is not pretrained.
57
75
 
58
76
  .. rubric:: Temporal, Spatial, and Spectral Encoding
59
77
 
@@ -74,51 +92,56 @@ class BBL(EEGModuleMixin, nn.Module, license="mit"):
74
92
  convolution or LSTM, and ``return_features`` adds ``temporal_features``,
75
93
  the encoder output before pooling.
76
94
 
77
- .. important::
95
+ .. rubric:: Pretrained Weights
78
96
 
79
- The released CamCAN checkpoint (slot 0) takes its 306 Elekta ``MEG*``
80
- channels in FIF order, 0.5 s windows at 250 Hz, band-passed 0.1-125 Hz
81
- with 50 and 100 Hz notches, scaled per channel by the recording's median
82
- and IQR, clipped to ``[-5, 5]``, first 0.5 s mean-subtracted (authors'
83
- ``data/preprocess.py``). Weights: ``braindecode/bbl-pretrained``
84
- (revision ``5a19a369``); the head is not pretrained::
97
+ ``braindecode/bbl-pretrained`` (revision ``5a19a369``) holds the authors'
98
+ CamCAN checkpoint (slot 0); the head is not pretrained::
85
99
 
86
- from braindecode.models import BBL
87
- model = BBL.from_pretrained("braindecode/bbl-pretrained", n_outputs=2)
100
+ from braindecode.models import BBL
101
+ model = BBL.from_pretrained("braindecode/bbl-pretrained", n_outputs=2)
88
102
 
89
- .. versionadded:: 2.1
103
+ The checkpoint takes its 306 Elekta ``MEG*`` channels in FIF order,
104
+ band-passed 0.1-125 Hz with 50 and 100 Hz notches, then resampled to 250 Hz
105
+ (Section 4.1 of the paper), on 0.5 s windows (125 samples). Each window is
106
+ scaled per channel by the recording's median and IQR, clipped to
107
+ ``[-5, 5]`` and first 0.5 s mean-subtracted, so inputs are dimensionless
108
+ (authors' ``data/preprocess.py`` and ``data/utils.py``; ``forward`` only
109
+ does the zero-padding to 306 sensors). The paper's bad-channel interpolation
110
+ is not in the authors' code. On the same inputs, the features and the
111
+ gradients equal those of the authors' ``Backbone`` with these weights; the
112
+ mean-subject fallback differs by float32 rounding only (:gh:`1553`).
90
113
 
91
114
  Parameters
92
115
  ----------
93
- n_sensors : int
116
+ n_sensors : int, default=306
94
117
  Sensor slots of the projector; inputs with fewer channels are
95
118
  zero-padded, as the reference collator does (306: Elekta MEG).
96
- n_datasets : int
119
+ n_datasets : int, default=4
97
120
  Dataset slots of the projector gate.
98
- n_subjects : int
121
+ n_subjects : int, default=4096
99
122
  Rows of the subject embedding (the release: 1024 per dataset slot).
100
- subject_dim : int
123
+ subject_dim : int, default=16
101
124
  Subject embedding dimension.
102
- model_dim : int
125
+ model_dim : int, default=512
103
126
  Projector and encoder output dimension.
104
- sensor_kernel_size : int
127
+ sensor_kernel_size : int, default=3
105
128
  Kernel size of the projector's first convolution (3 in the release); odd,
106
129
  so that its padding ``sensor_kernel_size // 2`` keeps the length.
107
- downsample_kernel_size : int
130
+ downsample_kernel_size : int, default=3
108
131
  Kernel size of the projector's strided convolution (3 in the release);
109
132
  odd, padded by ``downsample_kernel_size // 2``.
110
- downsample_stride : int
133
+ downsample_stride : int, default=2
111
134
  Stride of that convolution, so the projector outputs
112
135
  ``ceil(n_times / downsample_stride)`` steps (2 in the release).
113
- n_filters : int
136
+ n_filters : int, default=128
114
137
  Channels after the first SEANet convolution.
115
- ratios : tuple of int
138
+ ratios : tuple of int, default=(4, 2, 2)
116
139
  SEANet downsampling ratios.
117
- kernel_size : int
140
+ kernel_size : int, default=7
118
141
  Kernel size of the first SEANet convolution.
119
- last_kernel_size : int
142
+ last_kernel_size : int, default=7
120
143
  Kernel size of the last SEANet convolution.
121
- activation : type[nn.Module]
144
+ activation : type[nn.Module], default=nn.GELU
122
145
  Activation of the projector (the SEANet keeps EnCodec's ELU).
123
146
 
124
147
  References
@@ -59,7 +59,18 @@ class CORTEG(EEGModuleMixin, nn.Module, license="mit"):
59
59
  ``n_merge_blocks`` blocks with their LayerNorms, and the head (about 297 K
60
60
  parameters for the small backbone); this module builds the network and
61
61
  freezes the channel codebook, and leaves LoRA and the freezing of the other
62
- parameters to the training code.
62
+ parameters to the training code. With ``B`` the batch, ``C = n_chans``,
63
+ ``D = embed_dim``, ``P`` the patches per electrode (``n_times /
64
+ patch_size``, rounded as ``on_non_divisible`` says) and ``N = P * C``::
65
+
66
+ x (B, C, T), x_hi (B, C, T_hi), pos (B, C, 3)
67
+ -> patch embeddings lo (B, N, D), hi (B, N, D)
68
+ -> + temporal and channel embedding of each token
69
+ -> CLS token, low-frequency tokens (B, 1 + N, D)
70
+ -> encoder blocks, with the fusion (B, 1 + N, D)
71
+ -> norm (B, 1 + N, D)
72
+ -> mean over all tokens (B, D)
73
+ -> final_layer (B, n_outputs)
63
74
 
64
75
  .. rubric:: Macro Components
65
76
 
@@ -69,7 +80,10 @@ class CORTEG(EEGModuleMixin, nn.Module, license="mit"):
69
80
  ``x_hi`` into patches of ``hi_patch_size``, each linearly embedded and
70
81
  the high-gamma tokens average-pooled to the low-frequency count. The
71
82
  high-gamma embedding starts from the pretrained low-frequency one,
72
- linearly interpolated to its patch size.
83
+ linearly interpolated to its patch size. *Role:* keep the pretrained
84
+ low-frequency tokenization and add the high-gamma dynamics on the same
85
+ token grid, so that both streams get the same temporal and channel
86
+ embeddings (Section 3.1 of the paper).
73
87
  - **KNNSoftFourier spatial adapter** (``CORTEG.channel_adapter``).
74
88
  *Operations:* a soft branch maps each electrode position to softmax
75
89
  weights over the 142 positioned slots of the pretrained channel
@@ -84,13 +98,21 @@ class CORTEG(EEGModuleMixin, nn.Module, license="mit"):
84
98
  - **Transformer encoder** (``CORTEG.encoder``). *Operations:* the
85
99
  ``depth`` pretrained pre-norm ViT blocks of ST-EEGFormer, over a CLS
86
100
  token and the (time-patch, channel) tokens of the low-frequency stream.
101
+ *Role:* the pretrained backbone, which extracts EEG-like low-frequency
102
+ representations; with ``"average"`` its first ``depth - n_merge_blocks``
103
+ blocks read the low-frequency stream alone (Section 3.1).
87
104
  - **Late fusion** (``merge_strategy``). *Operations:* ``"average"``
88
105
  replaces the low-frequency tokens by their mean with the high-gamma
89
106
  tokens before the last ``n_merge_blocks`` blocks; ``"layerwise_gate"``
90
107
  adds the high-gamma tokens after every block, scaled per block and per
91
- sample by a small gate network that starts at zero.
108
+ sample by a small gate network that starts at zero. *Role:* bring the
109
+ high-gamma activity into the backbone, after its early blocks have read
110
+ the low-frequency stream (``"average"``, the paper's late fusion,
111
+ Section 3.1) or at every block, which avoids searching for the merge
112
+ point (``"layerwise_gate"``, Section 5.4).
92
113
  - **Read-out** (``CORTEG.norm``, ``CORTEG.final_layer``). *Operations:*
93
- layer norm, mean over all tokens (CLS included), linear head.
114
+ layer norm, mean over all tokens (CLS included), linear head. *Role:*
115
+ one vector per window, projected to ``n_outputs`` values (Section 3.1).
94
116
 
95
117
  .. rubric:: Temporal, Spatial, and Spectral Encoding
96
118
 
@@ -117,76 +139,90 @@ class CORTEG(EEGModuleMixin, nn.Module, license="mit"):
117
139
  batches one patient at a time: padded channels take part in no
118
140
  attention and no pooling.
119
141
 
120
- .. important::
142
+ .. rubric:: Pretrained Weights
121
143
 
122
- The ST-EEGFormer small backbone, with the high-gamma embedding
123
- warm-started from its low-frequency one, loads from the re-hosted
124
- checkpoint; the adapter, gate and head keep their initialization::
144
+ The ST-EEGFormer small backbone, with the high-gamma embedding
145
+ warm-started from its low-frequency one, loads from the re-hosted
146
+ checkpoint; the adapter, gate and head keep their initialization::
125
147
 
126
- model = CORTEG.from_pretrained(
127
- "braindecode/corteg-small-pretrained", n_outputs=5, n_times=128,
128
- chs_info=chs_info,
129
- )
148
+ model = CORTEG.from_pretrained(
149
+ "braindecode/corteg-small-pretrained", n_outputs=5, n_times=128,
150
+ chs_info=chs_info,
151
+ )
130
152
 
131
- The authors' Stanford model (finger flexion, nine patients pooled) is
132
- re-hosted with its LoRA factors folded in::
153
+ The authors' Stanford model (finger flexion, nine patients pooled) is
154
+ re-hosted with its LoRA factors folded in::
133
155
 
134
- model = CORTEG.from_pretrained(
135
- "braindecode/corteg-stanford-pooled", chs_info=chs_info
136
- )
156
+ model = CORTEG.from_pretrained(
157
+ "braindecode/corteg-stanford-pooled", chs_info=chs_info
158
+ )
159
+
160
+ The Stanford model reads 1 s windows of the two streams above (``x`` of 128
161
+ and ``x_hi`` of 200 samples) after a notch at 60, 120 and 180 Hz and a
162
+ common average reference (``data/stanford_preprocessing/`` of the authors'
163
+ repository). The outputs match the reference implementation
164
+ (``LiuyinYang1101/CORTEG`` at ``caafb78``) for the same weights and inputs,
165
+ up to float32 rounding, for both merge strategies (:gh:`1551`).
166
+
167
+ A bare ``STEEGFormer`` checkpoint (``braindecode/STEEGFormer-small``) is not
168
+ a CORTEG checkpoint. It has no high-gamma embedding and names the channel
169
+ table ``channel_pos.embedding.weight``, so ``strict=True`` raises, and
170
+ ``strict=False`` leaves ``channel_codebook`` at zero and derives
171
+ ``patch_embed_hi`` from the random initialization. Load
172
+ ``braindecode/corteg-small-pretrained`` instead.
137
173
 
138
174
  Parameters
139
175
  ----------
140
- patch_size : int
176
+ patch_size : int, default=16
141
177
  Patch size of the low-frequency stream (16 for the released
142
178
  backbones).
143
- hi_patch_size : int
179
+ hi_patch_size : int, default=25
144
180
  Patch size of the high-gamma stream.
145
- n_temporal_positions : int
181
+ n_temporal_positions : int, default=2048
146
182
  Positions of the fixed temporal encoding, CLS token included (2048, as in
147
183
  STEEGFormer); a window has at most ``n_temporal_positions - 1`` patches.
148
- embed_dim : int
184
+ embed_dim : int, default=512
149
185
  Token embedding dimension (512 for the small backbone).
150
- depth : int
186
+ depth : int, default=8
151
187
  Number of Transformer encoder blocks.
152
- num_heads : int
188
+ num_heads : int, default=8
153
189
  Number of attention heads.
154
- mlp_ratio : int
190
+ mlp_ratio : int, default=4
155
191
  Hidden-to-embedding ratio of the MLP blocks.
156
- norm_eps : float
192
+ norm_eps : float, default=1e-6
157
193
  Epsilon of the LayerNorms of the blocks and of the final norm (1e-6, as in
158
194
  STEEGFormer).
159
- drop_prob : float
195
+ drop_prob : float, default=0.0
160
196
  Dropout rate.
161
- drop_path : float
197
+ drop_path : float, default=0.1
162
198
  Stochastic-depth rate (max of a linear schedule over ``depth``).
163
- activation : type[nn.Module]
199
+ activation : type[nn.Module], default=nn.GELU
164
200
  Activation layer class of the feed-forward blocks and of the MLPs of
165
201
  the spatial adapter and the gate.
166
- merge_strategy : {"average", "layerwise_gate"}
202
+ merge_strategy : {"average", "layerwise_gate"}, default="average"
167
203
  Fusion of the high-gamma stream: the paper's default mean before the
168
204
  last ``n_merge_blocks`` blocks (the released Stanford adapter), or the
169
205
  layer-wise gate (its BrainTreebank results).
170
- n_merge_blocks : int
206
+ n_merge_blocks : int, default=4
171
207
  Number of blocks after the ``"average"`` fusion.
172
- knn_k : int
208
+ knn_k : int, default=8
173
209
  Number of nearest scalp slots of the soft branch's initial kernel.
174
- min_bandwidth : float
210
+ min_bandwidth : float, default=1e-6
175
211
  Smallest bandwidth of that kernel, in metres (1e-6).
176
- weight_eps : float
212
+ weight_eps : float, default=1e-8
177
213
  Floor that keeps the normalization and the logarithm of the kernel
178
214
  weights finite (1e-8).
179
- adapter_hidden : int
215
+ adapter_hidden : int, default=128
180
216
  Hidden width of the spatial adapter's MLPs.
181
- n_fourier_freqs : int
217
+ n_fourier_freqs : int, default=32
182
218
  Number of Fourier frequencies per axis of the residual branch.
183
- fourier_max_freq : float
219
+ fourier_max_freq : float, default=50.0
184
220
  Highest of those frequencies, log-spaced from 1, in radians per metre.
185
- gate_bottleneck : int
221
+ gate_bottleneck : int, default=16
186
222
  Hidden width of the layer-wise gate.
187
- init_std : float
223
+ init_std : float, default=0.02
188
224
  Standard deviation of the normal initialization of the CLS token (0.02).
189
- on_non_divisible : {"pad", "crop", "error"}
225
+ on_non_divisible : {"pad", "crop", "error"}, default="pad"
190
226
  How a stream whose length is not a multiple of its patch size is
191
227
  handled (right zero-pad, crop, or raise); the reference crops.
192
228
 
@@ -33,22 +33,32 @@ class MEGGPT(EEGModuleMixin, nn.Module, license="mit"):
33
33
  :bdg-danger:`Foundation Model` :bdg-info:`Attention/Transformer`
34
34
  :bdg-secondary:`Recurrent`
35
35
 
36
+ .. versionadded:: 2.1
37
+
36
38
  .. rubric:: Architecture Overview
37
39
 
40
+ With ``B`` the batch, ``C = n_chans``, ``D = embed_dim`` and ``S`` the number
41
+ of segments (``n_times``, padded or cropped to a multiple of the segment
42
+ length, divided by it):
43
+
38
44
  1. The EphysTokenizer encoder [ephystokenizer]_ turns each channel into a
39
45
  stream of discrete tokens, one per sample: a GRU runs over the channel,
40
46
  a linear layer and a layer norm give one logit per codebook entry, and
41
47
  the argmax is remapped to a token id through the released vocabulary.
48
+ ``x (B, C, T) -> token ids (B, C, S * 100)``.
42
49
  2. The token stream is cut into segments of ``n_patches[0] * patch_lens[0]``
43
50
  tokens (100, i.e. 0.4 s at 250 Hz). Token, time and channel embeddings
44
- are summed.
51
+ are summed. ``-> (B * S, 100, C, D)``.
45
52
  3. A stack of causal time-attention layers runs on every channel. In layer
46
53
  ``i`` the keys and values are pooled into ``n_patches[i]`` patches of
47
54
  ``patch_lens[i]`` steps and the output keeps the last steps only, so the
48
55
  sequence shrinks to ``n_last_steps`` outputs per segment.
56
+ ``-> (B * S, n_last_steps, C, D)``, merged to
57
+ ``(B, S * n_last_steps, C, D)``.
49
58
  4. The outputs are averaged over time and segments into
50
59
  ``(batch, n_chans, embed_dim)`` features (Section 2.4 of the paper),
51
60
  flattened and classified by a linear layer.
61
+ ``-> (B, C, D) -> (B, C * D) -> (B, n_outputs)``.
52
62
 
53
63
  .. rubric:: Macro Components
54
64
 
@@ -86,29 +96,46 @@ class MEGGPT(EEGModuleMixin, nn.Module, license="mit"):
86
96
  .. rubric:: Additional Mechanisms
87
97
 
88
98
  - **Input:** the 52 parcels of the Glasser 52 parcellation in the released
89
- order, sign-flip aligned (Section 2.5.3), at 250 Hz and z-scored over the
90
- recording; the model neither normalises nor checks ``sfreq``. With
91
- ``on_non_divisible="pad"``, the feature mean skips the kept steps after
92
- the end of the input.
93
- - **Channel mask:** with ``return_features=True``, ``ch_mask`` (real channels
94
- first) gives each recording the features of its real parcels run alone,
95
- and zeros for padded channels. The flattened head is tied to
96
- ``n_chans``, so without ``return_features`` it raises a ``ValueError``.
99
+ order, since the channel embedding is indexed by position, sign-flip
100
+ aligned (Section 2.5.3), at 250 Hz and z-scored over the recording
101
+ (``tokenize_session(standardize=True)`` in the reference); the model
102
+ neither normalises nor checks ``sfreq``. With ``on_non_divisible="pad"``,
103
+ the feature mean skips the kept steps after the end of the input.
104
+ - **Channel mask:** with ``return_features=True``, ``ch_mask`` (the mask of
105
+ :func:`~braindecode.datasets.pad_channels_collate`, real channels first)
106
+ gives each recording the features of its real parcels run alone, and
107
+ zeros for padded channels. The flattened head is tied to ``n_chans``, so
108
+ without ``return_features`` it raises a ``ValueError``.
97
109
  - **Token mask:** ``token_mask`` (True=hide) zeroes selected clean token
98
- embeddings before the causal decoder, and :meth:`encode_tokens` returns
99
- next-token targets for a downstream vocabulary head.
110
+ embeddings before the causal decoder, without changing the frozen
111
+ tokenizer or the attention masks; it is neither the released pretraining
112
+ method nor a bidirectional masked-sample reconstruction objective.
113
+ :meth:`encode_tokens` returns next-token targets for a downstream
114
+ vocabulary head; the encoder installs none.
100
115
  - **Session embedding:** the released model adds one for its 621 Cam-CAN
101
116
  sessions; the paper discards it downstream (Section 2.5.4), so the class
102
- has none and the converted weights drop it.
103
- - **Weights:** the released Cam-CAN MEG-GPT and EphysTokenizer weights,
104
- converted to this class's keys without the next-token head and the
105
- tokenizer's signal decoder, are at ``braindecode/meggpt-pretrained``
106
- (revision ``5c49e27c``); the head is randomly initialized::
107
-
108
- from braindecode.models import MEGGPT
109
- model = MEGGPT.from_pretrained("braindecode/meggpt-pretrained", n_outputs=4)
110
-
111
- .. versionadded:: 2.1
117
+ has none, the converted weights drop it, and the forward equals the
118
+ released model called without session labels.
119
+ - **Not ported:** only the released configuration, time attention with
120
+ patching. The reference's optional channel and cross attention, unpatched
121
+ keys, rotary or sinusoidal positions and batch/group norms are not
122
+ implemented.
123
+
124
+ .. rubric:: Pretrained Weights
125
+
126
+ The released Cam-CAN MEG-GPT and EphysTokenizer weights, converted to this
127
+ class's keys without the next-token head and the tokenizer's signal
128
+ decoder, are at ``braindecode/meggpt-pretrained`` (revision ``5c49e27c``);
129
+ the head is randomly initialized::
130
+
131
+ from braindecode.models import MEGGPT
132
+ model = MEGGPT.from_pretrained("braindecode/meggpt-pretrained", n_outputs=4)
133
+
134
+ They expect the input described above: source-space MEG at 250 Hz, the 52
135
+ parcels in the released order, sign-flip aligned and z-scored over the
136
+ recording (Section 2.5.3). On the same token ids, the decoder outputs and
137
+ the features equal those of the authors' model called without session
138
+ labels (:gh:`1555`).
112
139
 
113
140
  Parameters
114
141
  ----------
@@ -75,6 +75,9 @@ class NICE(EEGModuleMixin, nn.Module, license="mit"):
75
75
  NICE-GA) are not included.
76
76
  - ``mask`` hides raw samples before the temporal convolution, and
77
77
  ``return_features`` adds the temporal ``"tokens"`` (see :meth:`forward`).
78
+ - No pretrained weights: the authors' checkpoint (``eeyhsong/NICE``,
79
+ CC-BY-NC-ND-4.0, 10 subjects of THINGS-EEG2) is not supported; at its
80
+ revision ``7f98b08`` the encoder file is truncated.
78
81
 
79
82
  `License <https://github.com/eeyhsong/NICE-EEG/blob/main/LICENSE>`_
80
83
 
@@ -0,0 +1 @@
1
+ __version__ = "2.1.0.dev4294968711"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 2.1.0.dev4294968710
3
+ Version: 2.1.0.dev4294968711
4
4
  Summary: Deep learning software to decode EEG, ECG or MEG signals
5
5
  Author-email: Robin Tibor Schirrmeister <robintibor@gmail.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Alexandre Gramfort <agramfort@meta.com>
6
6
  Maintainer-email: Alexandre Gramfort <agramfort@meta.com>, Bruno Aristimunha Pinto <b.aristimunha@gmail.com>, Robin Tibor Schirrmeister <robintibor@gmail.com>
@@ -1 +0,0 @@
1
- __version__ = "2.1.0.dev4294968710"