braindecode 1.8.0.dev580__tar.gz → 1.8.0.dev1115__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 (179) hide show
  1. {braindecode-1.8.0.dev580/braindecode.egg-info → braindecode-1.8.0.dev1115}/PKG-INFO +1 -1
  2. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/augmentation/base.py +25 -1
  3. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/augmentation/functional.py +2 -4
  4. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/augmentation/transforms.py +5 -3
  5. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/base.py +40 -1
  6. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/samplers/base.py +40 -2
  7. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/training/losses.py +7 -4
  8. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/util.py +16 -10
  9. braindecode-1.8.0.dev1115/braindecode/version.py +1 -0
  10. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115/braindecode.egg-info}/PKG-INFO +1 -1
  11. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/whats_new.rst +59 -0
  12. braindecode-1.8.0.dev580/braindecode/version.py +0 -1
  13. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/LICENSE.txt +0 -0
  14. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/MANIFEST.in +0 -0
  15. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/NOTICE.txt +0 -0
  16. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/README.rst +0 -0
  17. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/__init__.py +0 -0
  18. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/augmentation/__init__.py +0 -0
  19. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/classifier.py +0 -0
  20. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/__init__.py +0 -0
  21. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/base.py +0 -0
  22. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bbci.py +0 -0
  23. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bcicomp.py +0 -0
  24. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/__init__.py +0 -0
  25. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/datasets.py +0 -0
  26. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/format.py +0 -0
  27. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/hub.py +0 -0
  28. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/hub_format.py +0 -0
  29. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/hub_io.py +0 -0
  30. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/hub_validation.py +0 -0
  31. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/bids/iterable.py +0 -0
  32. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/chb_mit.py +0 -0
  33. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/collate.py +0 -0
  34. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/mne.py +0 -0
  35. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/moabb.py +0 -0
  36. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/nmt.py +0 -0
  37. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/registry.py +0 -0
  38. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/siena.py +0 -0
  39. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
  40. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/sleep_physionet.py +0 -0
  41. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/tuh.py +0 -0
  42. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/utils.py +0 -0
  43. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datasets/xy.py +0 -0
  44. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datautil/__init__.py +0 -0
  45. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datautil/channel_utils.py +0 -0
  46. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datautil/hub_formats.py +0 -0
  47. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datautil/serialization.py +0 -0
  48. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/datautil/util.py +0 -0
  49. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/eegneuralnet.py +0 -0
  50. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/functional/__init__.py +0 -0
  51. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/functional/functions.py +0 -0
  52. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/functional/initialization.py +0 -0
  53. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/__init__.py +0 -0
  54. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/atcnet.py +0 -0
  55. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/attentionbasenet.py +0 -0
  56. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/attn_sleep.py +0 -0
  57. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/bendr.py +0 -0
  58. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/biot.py +0 -0
  59. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/brainmodule.py +0 -0
  60. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/cbramod.py +0 -0
  61. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/codebrain.py +0 -0
  62. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/config.py +0 -0
  63. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/contrawr.py +0 -0
  64. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/ctnet.py +0 -0
  65. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/dance.py +0 -0
  66. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/deep4.py +0 -0
  67. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/deepsleepnet.py +0 -0
  68. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/dgcnn.py +0 -0
  69. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegconformer.py +0 -0
  70. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegdino.py +0 -0
  71. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eeginception_erp.py +0 -0
  72. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eeginception_mi.py +0 -0
  73. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegitnet.py +0 -0
  74. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegminer.py +0 -0
  75. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegnet.py +0 -0
  76. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegnex.py +0 -0
  77. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegpt.py +0 -0
  78. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegsimpleconv.py +0 -0
  79. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegsym.py +0 -0
  80. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/eegtcnet.py +0 -0
  81. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/emg2qwerty.py +0 -0
  82. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/fbcnet.py +0 -0
  83. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/fblightconvnet.py +0 -0
  84. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/fbmsnet.py +0 -0
  85. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/hybrid.py +0 -0
  86. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/ifnet.py +0 -0
  87. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/interpolated.py +0 -0
  88. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/labram.py +0 -0
  89. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/luna.py +0 -0
  90. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/medformer.py +0 -0
  91. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/meta_neuromotor.py +0 -0
  92. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/msvtnet.py +0 -0
  93. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/mvpformer.py +0 -0
  94. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/patchedtransformer.py +0 -0
  95. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/reve.py +0 -0
  96. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sccnet.py +0 -0
  97. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/shallow_fbcsp.py +0 -0
  98. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/signal_jepa.py +0 -0
  99. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sinc_shallow.py +0 -0
  100. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
  101. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
  102. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sparcnet.py +0 -0
  103. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/sstdpn.py +0 -0
  104. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/steegformer.py +0 -0
  105. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/summary.csv +0 -0
  106. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/syncnet.py +0 -0
  107. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/tcformer.py +0 -0
  108. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/tcn.py +0 -0
  109. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/tidnet.py +0 -0
  110. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/tsinception.py +0 -0
  111. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/usleep.py +0 -0
  112. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/util.py +0 -0
  113. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/models/zuna.py +0 -0
  114. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/__init__.py +0 -0
  115. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/activation.py +0 -0
  116. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/attention.py +0 -0
  117. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/blocks.py +0 -0
  118. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/convolution.py +0 -0
  119. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/dance_modules.py +0 -0
  120. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/filter.py +0 -0
  121. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/interpolation.py +0 -0
  122. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/layers.py +0 -0
  123. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/linear.py +0 -0
  124. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/parametrization.py +0 -0
  125. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/stats.py +0 -0
  126. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/util.py +0 -0
  127. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/modules/wrapper.py +0 -0
  128. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/__init__.py +0 -0
  129. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
  130. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/mne_preprocess.py +0 -0
  131. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/preprocess.py +0 -0
  132. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/util.py +0 -0
  133. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/preprocessing/windowers.py +0 -0
  134. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/regressor.py +0 -0
  135. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/samplers/__init__.py +0 -0
  136. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/samplers/ssl.py +0 -0
  137. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/training/__init__.py +0 -0
  138. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/training/callbacks.py +0 -0
  139. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/training/scoring.py +0 -0
  140. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/__init__.py +0 -0
  141. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/attribution.py +0 -0
  142. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/confusion_matrices.py +0 -0
  143. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/frequency.py +0 -0
  144. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/metrics.py +0 -0
  145. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/sanity.py +0 -0
  146. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode/visualization/topology.py +0 -0
  147. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode.egg-info/SOURCES.txt +0 -0
  148. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode.egg-info/dependency_links.txt +0 -0
  149. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode.egg-info/requires.txt +0 -0
  150. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/braindecode.egg-info/top_level.txt +0 -0
  151. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/Makefile +0 -0
  152. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/_templates/autosummary/class.rst +0 -0
  153. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
  154. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/_templates/autosummary/function.rst +0 -0
  155. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
  156. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/api.rst +0 -0
  157. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/cite.rst +0 -0
  158. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/conf.py +0 -0
  159. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/help.rst +0 -0
  160. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/index.rst +0 -0
  161. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/install/install.rst +0 -0
  162. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/install/install_pip.rst +0 -0
  163. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/install/install_source.rst +0 -0
  164. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/attention.rst +0 -0
  165. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/channel.rst +0 -0
  166. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/convolution.rst +0 -0
  167. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/filterbank.rst +0 -0
  168. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/gnn.rst +0 -0
  169. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/interpretable.rst +0 -0
  170. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/lbm.rst +0 -0
  171. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/recurrent.rst +0 -0
  172. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/categorization/spd.rst +0 -0
  173. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/models.rst +0 -0
  174. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/models_categorization.rst +0 -0
  175. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/models_table.rst +0 -0
  176. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/models/models_visualization.rst +0 -0
  177. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/docs/sg_execution_times.rst +0 -0
  178. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/pyproject.toml +0 -0
  179. {braindecode-1.8.0.dev580 → braindecode-1.8.0.dev1115}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.8.0.dev580
3
+ Version: 1.8.0.dev1115
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>
@@ -3,6 +3,7 @@
3
3
  # Bruno Aristimunha <b.aristimunha@gmail.com>
4
4
  # Martin Wimpff <martin.wimpff@iss.uni-stuttgart.de>
5
5
  # Valentin Iovene <val@too.gy>
6
+ # Sarthak Tayal <sarthaktayal2@gmail.com>
6
7
  # License: BSD (3-clause)
7
8
 
8
9
  from numbers import Real
@@ -176,6 +177,14 @@ class Compose(Transform):
176
177
  return X, y
177
178
 
178
179
 
180
+ def _as_mixed_target(y, lam_dtype):
181
+ # an untouched target is the same as being mixed with itself with lam of one
182
+ if isinstance(y, (tuple, list)) and len(y) == 3:
183
+ return tuple(y)
184
+ lam = torch.ones(y.shape[0], device=y.device, dtype=lam_dtype)
185
+ return y, y, lam
186
+
187
+
179
188
  class _AugmentationCollate:
180
189
  """Collate that applies a transform to each batch, with optional expansion.
181
190
 
@@ -193,7 +202,10 @@ class _AugmentationCollate:
193
202
  ``0`` (default) applies the transform in place (batch size unchanged).
194
203
  ``> 0`` keeps the clean originals and appends ``n_augmentation``
195
204
  independently transformed copies, returning ``(X, y)`` of
196
- ``(1 + n_augmentation)`` times the original size.
205
+ ``(1 + n_augmentation)`` times the original size. When the transform
206
+ mixes targets, as :class:`braindecode.augmentation.Mixup` does, ``y``
207
+ stays the ``(y_a, y_b, lam)`` triple and the clean originals get a
208
+ mixing coefficient of one.
197
209
  """
198
210
 
199
211
  def __init__(self, transform, device=None, n_augmentation=0):
@@ -216,6 +228,18 @@ class _AugmentationCollate:
216
228
  aug_X, aug_y = self.transform(X, y)
217
229
  xs.append(aug_X)
218
230
  ys.append(aug_y)
231
+ mixed_ys = [
232
+ aug_y
233
+ for aug_y in ys
234
+ if isinstance(aug_y, (tuple, list)) and len(aug_y) == 3
235
+ ]
236
+ if mixed_ys:
237
+ # a target-mixing transform such as Mixup returns (y_a, y_b, lam),
238
+ # so the parts are concatenated one by one and the untouched copies
239
+ # are given a mixing coefficient of one
240
+ lam_dtype = mixed_ys[0][2].dtype
241
+ ys = [_as_mixed_target(aug_y, lam_dtype) for aug_y in ys]
242
+ return torch.cat(xs), tuple(torch.cat(part) for part in zip(*ys))
219
243
  return torch.cat(xs), torch.cat(ys)
220
244
 
221
245
 
@@ -1065,13 +1065,11 @@ def mixup(
1065
1065
  batch_size, n_channels, n_times = X.shape
1066
1066
 
1067
1067
  X_mix = torch.zeros((batch_size, n_channels, n_times)).to(device)
1068
- y_a = torch.arange(batch_size).to(device)
1069
- y_b = torch.arange(batch_size).to(device)
1068
+ y_a = y.clone()
1069
+ y_b = y[idx_perm].clone()
1070
1070
 
1071
1071
  for idx in range(batch_size):
1072
1072
  X_mix[idx] = lam[idx] * X[idx] + (1 - lam[idx]) * X[idx_perm[idx]]
1073
- y_a[idx] = y[idx]
1074
- y_b[idx] = y[idx_perm[idx]]
1075
1073
 
1076
1074
  return X_mix, (y_a, y_b, lam)
1077
1075
 
@@ -1068,16 +1068,18 @@ class Mixup(Transform):
1068
1068
  device = X.device
1069
1069
  batch_size, _, _ = X.shape
1070
1070
 
1071
+ # lam follows the dtype of X, numpy draws float64 and that would leak
1072
+ # into the mixed signal and into the loss returned by mixup_criterion
1071
1073
  if self.alpha > 0:
1072
1074
  if self.beta_per_sample:
1073
1075
  lam = torch.as_tensor(
1074
1076
  self.rng.beta(self.alpha, self.alpha, batch_size)
1075
- ).to(device)
1077
+ ).to(device=device, dtype=X.dtype)
1076
1078
  else:
1077
- lam = torch.ones(batch_size).to(device)
1079
+ lam = torch.ones(batch_size, dtype=X.dtype).to(device)
1078
1080
  lam *= self.rng.beta(self.alpha, self.alpha)
1079
1081
  else:
1080
- lam = torch.ones(batch_size).to(device)
1082
+ lam = torch.ones(batch_size, dtype=X.dtype).to(device)
1081
1083
 
1082
1084
  idx_perm = torch.as_tensor(
1083
1085
  self.rng.permutation(
@@ -198,7 +198,34 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
198
198
  See :ref:`load-pretrained-models` for a complete tutorial.
199
199
  """
200
200
 
201
+ #: Attributes that :func:`torch.jit.script` must not introspect. The
202
+ #: signal-related properties raise :class:`ValueError` when their value was
203
+ #: neither given nor inferable, and ``mapping`` carries a postponed
204
+ #: annotation TorchScript cannot resolve. Either one aborts scripting
205
+ #: before ``forward`` is ever compiled.
206
+ __jit_ignored_attributes__ = [
207
+ *sorted(_EEG_PARAMS),
208
+ "_chs_info",
209
+ "input_shape",
210
+ "mapping",
211
+ ]
212
+ #: Rich MNE channel dictionaries are intentionally unavailable in scripted
213
+ #: forwards; they remain unchanged on eager models and in saved configs.
214
+ __jit_unused_properties__ = ["chs_info"]
215
+
201
216
  def __init_subclass__(cls, **kwargs):
217
+ # TorchScript only honours ``__jit_ignored_attributes__`` for
218
+ # properties defined directly on the concrete class: it collects them
219
+ # with ``vars(type(module))``, which skips inherited ones. Rebinding
220
+ # the very same property objects on each subclass makes them visible
221
+ # there without changing any runtime behaviour.
222
+ for name in cls.__jit_ignored_attributes__:
223
+ if name in cls.__dict__:
224
+ continue
225
+ prop = getattr(cls, name, None)
226
+ if isinstance(prop, property):
227
+ setattr(cls, name, prop)
228
+
202
229
  # Append model-specific Hub integration notes to the docstring.
203
230
  # This runs before the metaclass __init__, so the Hub notes will
204
231
  # be included in the docstring that the metaclass processes.
@@ -286,6 +313,12 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
286
313
  self._chs_info = chs_info # type: ignore[assignment]
287
314
  self._n_outputs = n_outputs # type: ignore[assignment]
288
315
  self._n_chans = n_chans # type: ignore[assignment]
316
+ # TorchScript cannot represent the rich MNE dictionaries in _chs_info.
317
+ # Keep the original eager state above and expose only the derived scalar
318
+ # to scripted signal-property getters.
319
+ self._n_chans_for_jit = (
320
+ len(chs_info) if n_chans is None and chs_info is not None else n_chans
321
+ )
289
322
  self._n_times = n_times # type: ignore[assignment]
290
323
  self._sfreq = sfreq # type: ignore[assignment]
291
324
 
@@ -310,6 +343,12 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
310
343
 
311
344
  @property
312
345
  def n_chans(self) -> int:
346
+ if torch.jit.is_scripting():
347
+ if self._n_chans_for_jit is None:
348
+ raise ValueError(
349
+ "n_chans could not be inferred. Either specify n_chans or chs_info."
350
+ )
351
+ return self._n_chans_for_jit
313
352
  if self._n_chans is None and self._chs_info is not None:
314
353
  return len(self._chs_info)
315
354
  elif self._n_chans is None:
@@ -319,7 +358,7 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
319
358
  return self._n_chans
320
359
 
321
360
  @property
322
- def chs_info(self) -> list[str]:
361
+ def chs_info(self) -> list[dict]:
323
362
  if self._chs_info is None:
324
363
  raise ValueError("chs_info not specified.")
325
364
  return self._chs_info
@@ -5,6 +5,7 @@ Sampler classes.
5
5
  # Authors: Hubert Banville <hubert.jbanville@gmail.com>
6
6
  # Theo Gnassounou <>
7
7
  # Young Truong <dt.young112@gmail.com>
8
+ # Sarthak Tayal <sarthaktayal2@gmail.com>
8
9
  #
9
10
  # License: BSD (3-clause)
10
11
 
@@ -219,6 +220,9 @@ class DistributedRecordingSampler(DistributedSampler):
219
220
  class SequenceSampler(RecordingSampler):
220
221
  """Sample sequences of consecutive windows.
221
222
 
223
+ Recordings holding fewer than ``n_windows`` windows cannot contain a full
224
+ sequence and contribute none.
225
+
222
226
  Parameters
223
227
  ----------
224
228
  metadata : pd.DataFrame
@@ -227,7 +231,7 @@ class SequenceSampler(RecordingSampler):
227
231
  Number of consecutive windows in a sequence.
228
232
  n_windows_stride : int
229
233
  Number of windows between two consecutive sequences.
230
- random : bool
234
+ randomize : bool
231
235
  If True, sample sequences randomly. If False, sample sequences in
232
236
  order.
233
237
  random_state : np.random.RandomState | int | None
@@ -269,7 +273,10 @@ class SequenceSampler(RecordingSampler):
269
273
  .apply(lambda x: x[: end_offset : self.n_windows_stride])
270
274
  .values
271
275
  )
272
- file_ids = [[i] * len(inds) for i, inds in enumerate(start_inds)]
276
+ # a typed array keeps the ids integer when a recording yields no sequence
277
+ file_ids = [
278
+ np.full(len(inds), i, dtype=np.int64) for i, inds in enumerate(start_inds)
279
+ ]
273
280
  return np.concatenate(start_inds), np.concatenate(file_ids)
274
281
 
275
282
  def __len__(self):
@@ -296,6 +303,10 @@ class BalancedSequenceSampler(RecordingSampler):
296
303
  3. Sample a window of the corresponding class in the selected recording.
297
304
  4. Extract a sequence of windows around the sampled window.
298
305
 
306
+ Recordings holding fewer than ``n_windows`` windows cannot contain a full
307
+ sequence and are left out of step 1, as they are in
308
+ :class:`SequenceSampler`.
309
+
299
310
  Parameters
300
311
  ----------
301
312
  metadata : pd.DataFrame
@@ -322,6 +333,33 @@ class BalancedSequenceSampler(RecordingSampler):
322
333
  self.n_windows = n_windows
323
334
  self.n_sequences = n_sequences
324
335
  self.info_class = self._init_info(metadata, required_keys=["target"])
336
+ self.long_enough_recordings = self._find_long_enough_recordings()
337
+
338
+ def _find_long_enough_recordings(self):
339
+ """Return the indices of the recordings that can hold a full sequence.
340
+
341
+ Returns
342
+ -------
343
+ np.ndarray :
344
+ Array of recording indices holding at least ``n_windows`` windows.
345
+ """
346
+ n_windows_per_rec = self.info["index"].apply(len).to_numpy()
347
+ if n_windows_per_rec.size == 0:
348
+ raise ValueError("Cannot build sequences from empty metadata.")
349
+
350
+ long_enough = np.flatnonzero(n_windows_per_rec >= self.n_windows)
351
+ if len(long_enough) == 0:
352
+ raise ValueError(
353
+ f"No recording holds enough windows to build a sequence of "
354
+ f"{self.n_windows} windows. The longest recording has "
355
+ f"{n_windows_per_rec.max()} windows. Reduce n_windows to at "
356
+ f"most that value."
357
+ )
358
+ return long_enough
359
+
360
+ def sample_recording(self):
361
+ """Return a random recording index among the ones long enough."""
362
+ return self.rng.choice(self.long_enough_recordings)
325
363
 
326
364
  def sample_class(self, rec_ind=None):
327
365
  """Return a random class.
@@ -1,6 +1,7 @@
1
1
  # Authors: Robin Schirrmeister <robintibor@gmail.com>
2
2
  # Maciej Sliwowski <maciek.sliwowski@gmail.com>
3
3
  # Mohammed Fattouh <mo.fattouh@gmail.com>
4
+ # Sarthak Tayal <sarthaktayal2@gmail.com>
4
5
  #
5
6
  # License: BSD (3-clause)
6
7
 
@@ -79,10 +80,11 @@ def mixup_criterion(preds, target):
79
80
  ----------
80
81
  preds : torch.Tensor
81
82
  Predictions from the model.
82
- target : torch.Tensor | list of torch.Tensor
83
+ target : torch.Tensor | tuple of torch.Tensor | list of torch.Tensor
83
84
  For predictions without mixup, the targets as a tensor. If mixup has
84
- been applied, a list containing the targets of the two mixed
85
- samples and the mixing coefficients as tensors.
85
+ been applied, a tuple or list containing the targets of the two mixed
86
+ samples and the mixing coefficients as tensors. A plain tensor is
87
+ always read as targets, whatever the batch size is.
86
88
 
87
89
  Returns
88
90
  -------
@@ -96,7 +98,8 @@ def mixup_criterion(preds, target):
96
98
  Online: https://arxiv.org/abs/1710.09412
97
99
  .. [2] https://github.com/facebookresearch/mixup-cifar10/blob/master/train.py
98
100
  """
99
- if len(target) == 3:
101
+ # only a mixup target is a container, a plain target tensor of length 3 is not
102
+ if isinstance(target, (tuple, list)) and len(target) == 3:
100
103
  # unpack target
101
104
  y_a, y_b, lam = target
102
105
  # compute loss per sample
@@ -1,4 +1,5 @@
1
1
  # Authors: Robin Schirrmeister <robintibor@gmail.com>
2
+ # Sarthak Tayal <sarthaktayal2@gmail.com>
2
3
  #
3
4
  # License: BSD (3-clause)
4
5
  import glob
@@ -386,18 +387,23 @@ class ThrowAwayIndexLoader(object):
386
387
  if isinstance(x, dict):
387
388
  if hasattr(x["x"], "type"):
388
389
  x["x"] = x["x"].type(torch.float32)
389
- if hasattr(y, "type"):
390
- y = (
391
- y.type(torch.float32)
392
- if self.is_regression
393
- else y.type(torch.int64)
394
- )
390
+ cast_target = True
395
391
  elif hasattr(x, "type"):
396
392
  x = x.type(torch.float32)
397
- if self.is_regression:
398
- y = y.type(torch.float32)
399
- else:
400
- y = y.type(torch.int64)
393
+ cast_target = True
394
+ else:
395
+ cast_target = False
396
+ if cast_target:
397
+ target_dtype = torch.float32 if self.is_regression else torch.int64
398
+ if isinstance(y, (tuple, list)) and len(y) == 3:
399
+ y_a, y_b, lam = y
400
+ y = (
401
+ y_a.type(target_dtype),
402
+ y_b.type(target_dtype),
403
+ lam.type(torch.float32),
404
+ )
405
+ elif hasattr(y, "type"):
406
+ y = y.type(target_dtype)
401
407
  yield x, y
402
408
 
403
409
 
@@ -0,0 +1 @@
1
+ __version__ = "1.8.0.dev1115"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.8.0.dev580
3
+ Version: 1.8.0.dev1115
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>
@@ -28,6 +28,14 @@ Current 1.8.0 (GitHub)
28
28
  Enhancements
29
29
  ============
30
30
 
31
+ - Models with TorchScript-compatible forward paths can now be passed straight
32
+ to :func:`torch.jit.script`, without first being rebuilt as a plain
33
+ :class:`torch.nn.Module`.
34
+ :class:`braindecode.models.base.EEGModuleMixin` hides its signal-related
35
+ properties and the ``mapping`` attribute from TorchScript introspection, so
36
+ scripting reaches ``forward`` instead of failing on the class attributes.
37
+ (:gh:`1115` by `Aditya Singh`_)
38
+
31
39
  - Add a transfer-learning tutorial illustrating the TUAB-to-NMT pathology
32
40
  workflow with offline synthetic recordings
33
41
  (:gh:`580` by `Mohammad Javad D`_ and `Bruno Aristimunha`_).
@@ -48,10 +56,60 @@ Bug fixes
48
56
  - Make :class:`braindecode.datasets.SleepPhysionet` wake cropping retain the complete
49
57
  final sleep annotation without including an extra endpoint sample (:gh:`612` by
50
58
  `John Muradeli`_).
59
+
60
+ - Fix :func:`braindecode.training.mixup_criterion` treating a plain target
61
+ tensor of three elements as a mixup ``(y_a, y_b, lam)`` triple. The branch
62
+ was selected on ``len(target) == 3``, which is also true for the targets of
63
+ any batch holding three windows, so a validation batch or a last partial
64
+ batch of that size failed with ``Expected input batch_size (3) to match
65
+ target batch_size (0)``. The mixup branch is now selected on the container
66
+ type. (:gh:`1122` by `Sarthak Tayal`_)
67
+
68
+ - Keep the mixing coefficient of :class:`braindecode.augmentation.Mixup` on the
69
+ dtype of the batch. With ``beta_per_sample=True`` it came straight from numpy
70
+ as ``float64``, which upcast the loss returned by
71
+ :func:`braindecode.training.mixup_criterion` to ``float64`` while the model
72
+ stayed in ``float32``. (:gh:`1122` by `Sarthak Tayal`_)
73
+
74
+ - Let :class:`braindecode.augmentation.AugmentedDataLoader` used with
75
+ ``n_augmentation`` greater than zero carry the targets of a transform that
76
+ mixes them. Batches were concatenated as plain tensors, so combining that
77
+ option with :class:`braindecode.augmentation.Mixup` raised ``expected Tensor
78
+ as element 1 in argument 0, but got tuple``. The triple parts are now
79
+ concatenated one by one and the clean originals get a mixing coefficient of
80
+ one. (:gh:`1122` by `Sarthak Tayal`_)
81
+
82
+ - Let :class:`braindecode.EEGClassifier` and :class:`braindecode.EEGRegressor`
83
+ train with a transform that mixes targets. The loader wrapper cast every
84
+ target with ``y.type(...)``, so a batch carrying the ``(y_a, y_b, lam)``
85
+ triple of :class:`braindecode.augmentation.Mixup` stopped the fit with
86
+ ``'tuple' object has no attribute 'type'`` before the first batch was seen.
87
+ The triple parts now follow the same classification/regression dtype contract
88
+ as a plain target. (:gh:`1122` by `Sarthak Tayal`_).
89
+
51
90
  - Keep :class:`braindecode.preprocessing.EEGPrep` compatible with EEGPrep 0.3,
52
91
  which no longer exposes the ``eegprep.utils`` namespace used for sampling-rate
53
92
  validation (:gh:`1123` by `Bruno Aristimunha`_).
54
93
 
94
+ - Leave recordings shorter than ``n_windows`` out of the draw in
95
+ :class:`braindecode.samplers.BalancedSequenceSampler` instead of failing on
96
+ them. Such a recording holds no valid sequence start, which made the sampling
97
+ range empty and raised ``ValueError: high <= 0`` on the first sequence that
98
+ landed there. :class:`braindecode.samplers.SequenceSampler` already skips
99
+ those recordings. A clear error now names the longest recording when none of
100
+ them can hold a sequence (:gh:`1125` by `Sarthak Tayal`_).
101
+
102
+ - Keep ``file_ids`` of :class:`braindecode.samplers.SequenceSampler` integer.
103
+ The ids were built from untyped lists, so an empty list coming from a
104
+ recording too short for a sequence turned the concatenated array into
105
+ ``float64``, against the documented dtype and unusable as an index
106
+ (:gh:`1125` by `Sarthak Tayal`_).
107
+
108
+ - Document the ``randomize`` parameter of
109
+ :class:`braindecode.samplers.SequenceSampler` under its own name. The
110
+ docstring described it as ``random``, which no signature accepts
111
+ (:gh:`1125` by `Sarthak Tayal`_).
112
+
55
113
  Code health
56
114
  ============
57
115
 
@@ -1562,3 +1620,4 @@ Authors
1562
1620
  .. _Fashad Ahmed: https://github.com/Fashad-Ahmed
1563
1621
  .. _Bhargav Kowshik: https://github.com/bkowshik
1564
1622
  .. _Jon Huml: https://github.com/jonathanhuml
1623
+ .. _Aditya Singh: https://github.com/adityasingh2400
@@ -1 +0,0 @@
1
- __version__ = "1.8.0.dev580"