Braindecode 1.3.2.dev168517820__tar.gz → 1.3.2.dev168583761__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 (163) hide show
  1. {braindecode-1.3.2.dev168517820/braindecode.egg-info → braindecode-1.3.2.dev168583761}/PKG-INFO +3 -3
  2. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/augmentation/transforms.py +4 -6
  3. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/hub.py +2 -7
  4. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/__init__.py +0 -2
  5. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/base.py +97 -275
  6. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/bendr.py +6 -17
  7. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/biot.py +5 -23
  8. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/cbramod.py +6 -28
  9. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/config.py +29 -29
  10. braindecode-1.3.2.dev168583761/braindecode/models/deepsleepnet.py +417 -0
  11. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eeginception_mi.py +1 -2
  12. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegitnet.py +3 -4
  13. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegpt.py +2 -15
  14. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/labram.py +1 -15
  15. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/luna.py +21 -11
  16. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/patchedtransformer.py +3 -5
  17. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/reve.py +23 -59
  18. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/shallow_fbcsp.py +8 -16
  19. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/signal_jepa.py +13 -63
  20. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/util.py +3 -134
  21. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/__init__.py +1 -2
  22. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/activation.py +0 -20
  23. braindecode-1.3.2.dev168583761/braindecode/version.py +1 -0
  24. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761/braindecode.egg-info}/PKG-INFO +3 -3
  25. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode.egg-info/requires.txt +2 -2
  26. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/conf.py +7 -0
  27. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/models_categorization.rst +54 -55
  28. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/whats_new.rst +2 -71
  29. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/pyproject.toml +2 -11
  30. braindecode-1.3.2.dev168517820/braindecode/models/deepsleepnet.py +0 -477
  31. braindecode-1.3.2.dev168517820/braindecode/version.py +0 -1
  32. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/LICENSE.txt +0 -0
  33. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/MANIFEST.in +0 -0
  34. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/NOTICE.txt +0 -0
  35. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/README.rst +0 -0
  36. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/__init__.py +0 -0
  37. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/augmentation/__init__.py +0 -0
  38. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/augmentation/base.py +0 -0
  39. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/augmentation/functional.py +0 -0
  40. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/classifier.py +0 -0
  41. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/__init__.py +0 -0
  42. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/base.py +0 -0
  43. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bbci.py +0 -0
  44. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bcicomp.py +0 -0
  45. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/__init__.py +0 -0
  46. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/datasets.py +0 -0
  47. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/format.py +0 -0
  48. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/hub_format.py +0 -0
  49. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/hub_io.py +0 -0
  50. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/hub_validation.py +0 -0
  51. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/bids/iterable.py +0 -0
  52. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/chb_mit.py +0 -0
  53. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/mne.py +0 -0
  54. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/moabb.py +0 -0
  55. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/nmt.py +0 -0
  56. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/registry.py +0 -0
  57. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/siena.py +0 -0
  58. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/sleep_physio_challe_18.py +0 -0
  59. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/sleep_physionet.py +0 -0
  60. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/tuh.py +0 -0
  61. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/utils.py +0 -0
  62. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datasets/xy.py +0 -0
  63. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datautil/__init__.py +0 -0
  64. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datautil/channel_utils.py +0 -0
  65. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datautil/hub_formats.py +0 -0
  66. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datautil/serialization.py +0 -0
  67. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/datautil/util.py +0 -0
  68. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/eegneuralnet.py +0 -0
  69. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/functional/__init__.py +0 -0
  70. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/functional/functions.py +0 -0
  71. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/functional/initialization.py +0 -0
  72. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/atcnet.py +0 -0
  73. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/attentionbasenet.py +0 -0
  74. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/attn_sleep.py +0 -0
  75. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/brainmodule.py +0 -0
  76. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/contrawr.py +0 -0
  77. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/ctnet.py +0 -0
  78. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/deep4.py +0 -0
  79. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/dgcnn.py +0 -0
  80. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegconformer.py +0 -0
  81. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eeginception_erp.py +0 -0
  82. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegminer.py +0 -0
  83. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegnet.py +0 -0
  84. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegnex.py +0 -0
  85. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegsimpleconv.py +0 -0
  86. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegsym.py +0 -0
  87. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/eegtcnet.py +0 -0
  88. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/fbcnet.py +0 -0
  89. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/fblightconvnet.py +0 -0
  90. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/fbmsnet.py +0 -0
  91. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/hybrid.py +0 -0
  92. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/ifnet.py +0 -0
  93. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/medformer.py +0 -0
  94. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/msvtnet.py +0 -0
  95. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sccnet.py +0 -0
  96. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sinc_shallow.py +0 -0
  97. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sleep_stager_blanco_2020.py +0 -0
  98. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sleep_stager_chambon_2018.py +0 -0
  99. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sparcnet.py +0 -0
  100. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/sstdpn.py +0 -0
  101. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/summary.csv +0 -0
  102. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/syncnet.py +0 -0
  103. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/tcn.py +0 -0
  104. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/tidnet.py +0 -0
  105. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/tsinception.py +0 -0
  106. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/models/usleep.py +0 -0
  107. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/attention.py +0 -0
  108. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/blocks.py +0 -0
  109. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/convolution.py +0 -0
  110. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/filter.py +0 -0
  111. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/layers.py +0 -0
  112. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/linear.py +0 -0
  113. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/parametrization.py +0 -0
  114. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/stats.py +0 -0
  115. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/util.py +0 -0
  116. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/modules/wrapper.py +0 -0
  117. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/__init__.py +0 -0
  118. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/eegprep_preprocess.py +0 -0
  119. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/mne_preprocess.py +0 -0
  120. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/preprocess.py +0 -0
  121. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/util.py +0 -0
  122. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/preprocessing/windowers.py +0 -0
  123. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/regressor.py +0 -0
  124. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/samplers/__init__.py +0 -0
  125. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/samplers/base.py +0 -0
  126. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/samplers/ssl.py +0 -0
  127. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/training/__init__.py +0 -0
  128. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/training/callbacks.py +0 -0
  129. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/training/losses.py +0 -0
  130. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/training/scoring.py +0 -0
  131. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/util.py +0 -0
  132. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/visualization/__init__.py +0 -0
  133. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/visualization/confusion_matrices.py +0 -0
  134. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode/visualization/gradients.py +0 -0
  135. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode.egg-info/SOURCES.txt +0 -0
  136. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode.egg-info/dependency_links.txt +0 -0
  137. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/braindecode.egg-info/top_level.txt +0 -0
  138. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/Makefile +0 -0
  139. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/_templates/autosummary/class.rst +0 -0
  140. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/_templates/autosummary/class_in_subdir.rst +0 -0
  141. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/_templates/autosummary/function.rst +0 -0
  142. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/_templates/autosummary/function_in_subdir.rst +0 -0
  143. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/api.rst +0 -0
  144. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/cite.rst +0 -0
  145. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/help.rst +0 -0
  146. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/index.rst +0 -0
  147. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/install/install.rst +0 -0
  148. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/install/install_pip.rst +0 -0
  149. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/install/install_source.rst +0 -0
  150. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/attention.rst +0 -0
  151. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/channel.rst +0 -0
  152. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/convolution.rst +0 -0
  153. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/filterbank.rst +0 -0
  154. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/gnn.rst +0 -0
  155. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/interpretable.rst +0 -0
  156. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/lbm.rst +0 -0
  157. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/recurrent.rst +0 -0
  158. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/categorization/spd.rst +0 -0
  159. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/models.rst +0 -0
  160. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/models_table.rst +0 -0
  161. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/models/models_visualization.rst +0 -0
  162. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/docs/sg_execution_times.rst +0 -0
  163. {braindecode-1.3.2.dev168517820 → braindecode-1.3.2.dev168583761}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: braindecode
3
- Version: 1.3.2.dev168517820
3
+ Version: 1.3.2.dev168583761
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>
@@ -22,7 +22,7 @@ Requires-Python: >=3.11
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE.txt
24
24
  License-File: NOTICE.txt
25
- Requires-Dist: torch>=2.0
25
+ Requires-Dist: torch>=2.2
26
26
  Requires-Dist: torchaudio>=2.0
27
27
  Requires-Dist: mne>=1.11.0
28
28
  Requires-Dist: pandas<3.0.0
@@ -35,7 +35,7 @@ Requires-Dist: wfdb
35
35
  Requires-Dist: linear_attention_transformer
36
36
  Requires-Dist: docstring_inheritance
37
37
  Requires-Dist: rotary_embedding_torch
38
- Requires-Dist: pydantic>=2.0
38
+ Requires-Dist: pandas<3.0.0
39
39
  Provides-Extra: moabb
40
40
  Requires-Dist: moabb>=1.4.3; extra == "moabb"
41
41
  Provides-Extra: eegprep
@@ -2,7 +2,6 @@
2
2
  # Alexandre Gramfort <alexandre.gramfort@inria.fr>
3
3
  # Gustavo Rodrigues <gustavenrique01@gmail.com>
4
4
  # Bruna Lopes <brunajaflopes@gmail.com>
5
- # Sarthak Tayal <sarthaktayal2@gmail.com>
6
5
  #
7
6
  # License: BSD (3-clause)
8
7
 
@@ -558,9 +557,8 @@ class BandstopFilter(Transform):
558
557
  f" Nyquist frequency ({nyq} Hz)."
559
558
  f" Falling back to max_freq = {nyq}."
560
559
  )
561
- assert bandwidth < max_freq - 2, (
562
- f"`bandwidth` needs to be smaller than max_freq - 2={max_freq - 2} "
563
- f"to allow valid notch frequency sampling with 1 Hz transition bands."
560
+ assert bandwidth < max_freq, (
561
+ f"`bandwidth` needs to be smaller than max_freq={max_freq}"
564
562
  )
565
563
 
566
564
  # override bandwidth value when a magnitude is passed
@@ -602,8 +600,8 @@ class BandstopFilter(Transform):
602
600
 
603
601
  # Prevents transitions from going below 0 and above max_freq
604
602
  notched_freqs = self.rng.uniform(
605
- low=1 + self.bandwidth / 2,
606
- high=self.max_freq - 1 - self.bandwidth / 2,
603
+ low=1 + 2 * self.bandwidth,
604
+ high=self.max_freq - 1 - 2 * self.bandwidth,
607
605
  size=X.shape[0],
608
606
  )
609
607
  return {
@@ -845,16 +845,11 @@ class HubDatasetMixin:
845
845
 
846
846
  # Convert to MNE objects and create dataset
847
847
  info = Info.from_json_dict(info_dict)
848
- targets = metadata["target"].values
849
- if np.issubdtype(targets.dtype, np.integer):
850
- event_ids = targets
851
- else:
852
- event_ids = np.ones(len(metadata), dtype=int)
853
848
  events = np.column_stack(
854
849
  [
855
- metadata["i_start_in_trial"].values.astype(int),
850
+ metadata["i_start_in_trial"].values,
856
851
  np.zeros(len(metadata), dtype=int),
857
- event_ids,
852
+ metadata["target"].values,
858
853
  ]
859
854
  )
860
855
  epochs = mne.EpochsArray(data, info, events=events, metadata=metadata)
@@ -55,7 +55,6 @@ from .tsinception import TSception
55
55
  from .usleep import USleep
56
56
  from .util import (
57
57
  _init_models_dict,
58
- build_model_config,
59
58
  extract_channel_locations_from_chs_info,
60
59
  models_mandatory_parameters,
61
60
  )
@@ -119,7 +118,6 @@ __all__ = [
119
118
  "TIDNet",
120
119
  "TSception",
121
120
  "USleep",
122
- "build_model_config",
123
121
  "_init_models_dict",
124
122
  "models_mandatory_parameters",
125
123
  ]
@@ -17,13 +17,6 @@ from docstring_inheritance import NumpyDocstringInheritanceInitMeta
17
17
  from mne.utils import _soft_import
18
18
  from torchinfo import ModelStatistics, summary
19
19
 
20
- from braindecode.models.util import (
21
- _EEG_PARAMS,
22
- _IMPORT_ADAPTER,
23
- build_model_config,
24
- resolve_type_kwargs,
25
- track_model_init_kwargs,
26
- )
27
20
  from braindecode.version import __version__
28
21
 
29
22
  huggingface_hub = _soft_import(
@@ -59,25 +52,7 @@ def deprecated_args(obj, *old_new_args):
59
52
  return out_args
60
53
 
61
54
 
62
- class _BraindecodeDocstringMeta(NumpyDocstringInheritanceInitMeta):
63
- """Defer ``__init__`` wrapping until after docstring inheritance.
64
-
65
- ``NumpyDocstringInheritanceInitMeta`` uses ``inspect.unwrap()``
66
- internally, which bypasses ``@wraps`` wrappers. By wrapping
67
- ``__init__`` *after* docstring processing, the metaclass sees the
68
- unwrapped function and correctly inherits ``cls.__doc__``.
69
- """
70
-
71
- def __init__(cls, class_name, class_bases, class_dict):
72
- super().__init__(class_name, class_bases, class_dict)
73
- # Only wrap subclass __init__s, not EEGModuleMixin itself.
74
- # Wrapping the mixin would cause super().__init__() calls to
75
- # overwrite _braindecode_init_kwargs captured by the subclass.
76
- if any(isinstance(b, _BraindecodeDocstringMeta) for b in class_bases):
77
- track_model_init_kwargs(cls)
78
-
79
-
80
- class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
55
+ class EEGModuleMixin(_BaseHubMixin, metaclass=NumpyDocstringInheritanceInitMeta):
81
56
  """
82
57
  Mixin class for all EEG models in braindecode.
83
58
 
@@ -150,46 +125,24 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
150
125
  # Load pretrained model
151
126
  model = {name}.from_pretrained("username/my-{name_lower}-model")
152
127
 
153
- # Load with a different number of outputs (head is rebuilt automatically)
154
- model = {name}.from_pretrained("username/my-{name_lower}-model", n_outputs=4)
155
-
156
- **Extracting features and replacing the head:**
157
-
158
- .. code-block::
159
-
160
- import torch
161
-
162
- x = torch.randn(1, model.n_chans, model.n_times)
163
- # Extract encoder features (consistent dict across all models)
164
- out = model(x, return_features=True)
165
- features = out["features"]
166
-
167
- # Replace the classification head
168
- model.reset_head(n_outputs=10)
169
-
170
- **Saving and restoring full configuration:**
171
-
172
- .. code-block::
173
-
174
- import json
175
-
176
- config = model.get_config() # all __init__ params
177
- with open("config.json", "w") as f:
178
- json.dump(config, f)
179
-
180
- model2 = {name}.from_config(config) # reconstruct (no weights)
181
-
182
- All model parameters (both EEG-specific and model-specific such as
183
- dropout rates, activation functions, number of filters) are automatically
184
- saved to the Hub and restored when loading.
185
-
186
- See :ref:`load-pretrained-models` for a complete tutorial.
128
+ The integration automatically handles EEG-specific parameters (n_chans,
129
+ n_times, sfreq, chs_info, etc.) by saving them in a config file alongside
130
+ the model weights. This ensures that loaded models are correctly configured
131
+ for their original data specifications.
132
+
133
+ .. important::
134
+ Currently, only EEG-specific parameters (n_outputs, n_chans, n_times,
135
+ input_window_seconds, sfreq, chs_info) are saved to the Hub.
136
+ Model-specific parameters (e.g., dropout rates, activation functions,
137
+ number of filters) are not preserved and will use their default values
138
+ when loading from the Hub.
139
+ Full parameter serialization will be addressed in a future update.
187
140
  """
188
141
 
189
142
  def __init_subclass__(cls, **kwargs):
190
143
  # Append model-specific Hub integration notes to the docstring.
191
- # This runs before the metaclass __init__, so the Hub notes will
192
- # be included in the docstring that the metaclass processes.
144
+ # This runs after the metaclass, so we concatenate rather than
145
+ # override any existing Notes section in the subclass.
193
146
  if cls.__doc__ is not None:
194
147
  hub_notes = cls._HUB_NOTES_TEMPLATE.format(
195
148
  name=cls.__name__,
@@ -215,19 +168,6 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
215
168
  repo_url = kwargs.pop("repo_url", "https://braindecode.org")
216
169
  library_name = kwargs.pop("library_name", "braindecode")
217
170
  license = kwargs.pop("license", "bsd-3-clause")
218
-
219
- # Register a coder so that type[nn.Module] parameters
220
- # (e.g. activation=nn.ELU) are serialized as importable
221
- # strings in config.json and decoded back on load.
222
- coders = kwargs.pop("coders", None) or {}
223
- coders.setdefault(
224
- type,
225
- (
226
- lambda t: f"{t.__module__}.{t.__qualname__}",
227
- lambda data: _IMPORT_ADAPTER.validate_python(data),
228
- ),
229
- )
230
-
231
171
  # TODO: model_card_template can be added in the future for custom model cards
232
172
  super().__init_subclass__(
233
173
  tags=tags,
@@ -235,7 +175,6 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
235
175
  repo_url=repo_url,
236
176
  library_name=library_name,
237
177
  license=license,
238
- coders=coders,
239
178
  **kwargs,
240
179
  )
241
180
 
@@ -277,17 +216,6 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
277
216
  self._n_times = n_times # type: ignore[assignment]
278
217
  self._sfreq = sfreq # type: ignore[assignment]
279
218
 
280
- # Back-fill instance attributes from _hub_mixin_config for any
281
- # params the subclass didn't store on self. Skip EEG params
282
- # (stored as self._*) and descriptors (properties).
283
- for key, val in getattr(self, "_hub_mixin_config", {}).items():
284
- if key in _EEG_PARAMS:
285
- continue
286
- if hasattr(getattr(type(self), key, None), "__get__"):
287
- continue
288
- if not hasattr(self, key):
289
- setattr(self, key, val)
290
-
291
219
  super().__init__()
292
220
 
293
221
  @property
@@ -398,104 +326,6 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
398
326
  raise ValueError(msg) from exc
399
327
  raise exc
400
328
 
401
- def get_config(self) -> dict:
402
- """Return a JSON-serializable dict of all ``__init__`` parameters.
403
-
404
- The returned dictionary can be saved to a JSON file and later
405
- used with :meth:`from_config` to reconstruct the model (without
406
- weights). It is also used internally by :meth:`push_to_hub` to
407
- persist the full model configuration.
408
-
409
- Returns
410
- -------
411
- dict
412
- All ``__init__`` parameters, JSON-serializable.
413
- ``type[nn.Module]`` parameters (e.g. ``activation``) are
414
- encoded as importable dotted-path strings.
415
-
416
- Examples
417
- --------
418
- >>> import json
419
- >>> from braindecode.models import EEGNet
420
- >>> model = EEGNet(n_chans=22, n_times=1000, n_outputs=4, F1=16)
421
- >>> config = model.get_config()
422
- >>> config["F1"]
423
- 16
424
- >>> # Save to disk
425
- >>> with open("config.json", "w") as f:
426
- ... json.dump(config, f)
427
-
428
- .. versionadded:: 1.4
429
- """
430
- return build_model_config(self)
431
-
432
- @classmethod
433
- def from_config(cls, config: dict) -> "EEGModuleMixin":
434
- """Create a model instance from a configuration dict.
435
-
436
- This is the inverse of :meth:`get_config`. Weights are **not**
437
- loaded -- use :meth:`from_pretrained` for that.
438
-
439
- Parameters
440
- ----------
441
- config : dict
442
- Configuration dict as returned by :meth:`get_config`.
443
-
444
- Returns
445
- -------
446
- EEGModuleMixin
447
- A new model instance.
448
-
449
- Examples
450
- --------
451
- >>> import json
452
- >>> from braindecode.models import EEGNet
453
- >>> model = EEGNet(n_chans=22, n_times=1000, n_outputs=4, F1=16)
454
- >>> config = model.get_config()
455
- >>> # Reconstruct (without weights)
456
- >>> model2 = EEGNet.from_config(config)
457
- >>> model2.F1
458
- 16
459
- >>> # Or from a JSON file
460
- >>> with open("config.json") as f:
461
- ... config = json.load(f)
462
- >>> model3 = EEGNet.from_config(config)
463
-
464
- .. versionadded:: 1.4
465
- """
466
- config = dict(config) # shallow copy
467
- config.pop("braindecode_version", None)
468
- resolve_type_kwargs(cls, config)
469
- return cls(**config)
470
-
471
- def reset_head(self, n_outputs):
472
- """Replace the classification head for a new number of outputs.
473
-
474
- This is called automatically by :meth:`from_pretrained` when the
475
- user passes an ``n_outputs`` that differs from the saved config.
476
- Override in subclasses that need a model-specific head structure.
477
-
478
- Parameters
479
- ----------
480
- n_outputs : int
481
- New number of output classes.
482
-
483
- Examples
484
- --------
485
- >>> from braindecode.models import BENDR
486
- >>> model = BENDR(n_chans=22, n_times=1000, n_outputs=4)
487
- >>> model.reset_head(10)
488
- >>> model.n_outputs
489
- 10
490
-
491
- .. versionadded:: 1.4
492
- """
493
- raise NotImplementedError(
494
- f"{type(self).__name__} does not implement reset_head(). "
495
- "Override this method to support changing n_outputs after "
496
- "loading pretrained weights."
497
- )
498
-
499
329
  mapping: Optional[Dict[str, str]] = None
500
330
 
501
331
  def load_state_dict(self, state_dict, *args, **kwargs):
@@ -600,22 +430,54 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
600
430
 
601
431
  @staticmethod
602
432
  def _serialize_chs_info(chs_info):
603
- """Serialize MNE channel info (``info["chs"]``) to JSON-compatible dicts."""
433
+ """
434
+ Serialize MNE channel info to JSON-compatible format.
435
+
436
+ Parameters
437
+ ----------
438
+ chs_info : list of dict or None
439
+ Channel information from MNE Info object.
440
+
441
+ Returns
442
+ -------
443
+ list of dict or None
444
+ Serialized channel information that can be saved to JSON.
445
+ """
604
446
  if chs_info is None:
605
447
  return None
606
- _INT_FIELDS = ("kind", "coil_type", "unit")
607
- _FLOAT_FIELDS = ("cal", "range")
448
+
608
449
  serialized = []
609
450
  for ch in chs_info:
610
- ch_dict = {"ch_name": ch.get("ch_name", "")}
611
- for key in _INT_FIELDS:
612
- val = ch.get(key)
613
- if val is not None:
614
- ch_dict[key] = val if isinstance(val, str) else int(val)
615
- for key in _FLOAT_FIELDS:
616
- val = ch.get(key)
617
- if val is not None:
618
- ch_dict[key] = float(val)
451
+ # Extract serializable fields from MNE channel info
452
+ ch_dict = {
453
+ "ch_name": ch.get("ch_name", ""),
454
+ }
455
+
456
+ # Handle kind field - can be either string or integer
457
+ kind_val = ch.get("kind")
458
+ if kind_val is not None:
459
+ ch_dict["kind"] = (
460
+ kind_val if isinstance(kind_val, str) else int(kind_val)
461
+ )
462
+
463
+ # Add numeric fields with safe conversion
464
+ coil_type = ch.get("coil_type")
465
+ if coil_type is not None:
466
+ ch_dict["coil_type"] = int(coil_type)
467
+
468
+ unit = ch.get("unit")
469
+ if unit is not None:
470
+ ch_dict["unit"] = int(unit)
471
+
472
+ cal = ch.get("cal")
473
+ if cal is not None:
474
+ ch_dict["cal"] = float(cal)
475
+
476
+ range_val = ch.get("range")
477
+ if range_val is not None:
478
+ ch_dict["range"] = float(range_val)
479
+
480
+ # Serialize location array if present
619
481
  if "loc" in ch and ch["loc"] is not None:
620
482
  ch_dict["loc"] = (
621
483
  ch["loc"].tolist()
@@ -623,19 +485,35 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
623
485
  else list(ch["loc"])
624
486
  )
625
487
  serialized.append(ch_dict)
488
+
626
489
  return serialized
627
490
 
628
491
  @staticmethod
629
492
  def _deserialize_chs_info(chs_info_dict):
630
- """Deserialize JSON channel dicts back to MNE-compatible format."""
493
+ """
494
+ Deserialize channel info from JSON-compatible format to MNE-like structure.
495
+
496
+ Parameters
497
+ ----------
498
+ chs_info_dict : list of dict or None
499
+ Serialized channel information.
500
+
501
+ Returns
502
+ -------
503
+ list of dict or None
504
+ Deserialized channel information compatible with MNE.
505
+ """
631
506
  if chs_info_dict is None:
632
507
  return None
508
+
633
509
  deserialized = []
634
510
  for ch_dict in chs_info_dict:
635
511
  ch = ch_dict.copy()
512
+ # Convert location back to numpy array if present
636
513
  if "loc" in ch and ch["loc"] is not None:
637
514
  ch["loc"] = np.array(ch["loc"])
638
515
  deserialized.append(ch)
516
+
639
517
  return deserialized
640
518
 
641
519
  def _save_pretrained(self, save_directory):
@@ -655,8 +533,16 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
655
533
 
656
534
  save_directory = Path(save_directory)
657
535
 
658
- config = build_model_config(self)
659
- config["braindecode_version"] = __version__
536
+ # Collect EEG-specific configuration
537
+ config = {
538
+ "n_outputs": self._n_outputs,
539
+ "n_chans": self._n_chans,
540
+ "n_times": self._n_times,
541
+ "input_window_seconds": self._input_window_seconds,
542
+ "sfreq": self._sfreq,
543
+ "chs_info": self._serialize_chs_info(self._chs_info),
544
+ "braindecode_version": __version__,
545
+ }
660
546
 
661
547
  # Save to config.json
662
548
  config_path = save_directory / "config.json"
@@ -695,78 +581,14 @@ class EEGModuleMixin(_BaseHubMixin, metaclass=_BraindecodeDocstringMeta):
695
581
  **model_kwargs,
696
582
  ):
697
583
  model_kwargs.pop("braindecode_version", None)
698
- filename = model_kwargs.pop("filename", None)
699
- resolve_type_kwargs(cls, model_kwargs)
700
-
701
- # Read saved n_outputs from config.json to detect when the
702
- # user wants a different number of outputs. Works for both
703
- # local directories and Hub repo IDs.
704
- saved_n_outputs = None
705
- try:
706
- if Path(model_id).is_dir():
707
- config_file = Path(model_id) / "config.json"
708
- else:
709
- config_file = huggingface_hub.hf_hub_download(
710
- repo_id=model_id,
711
- filename="config.json",
712
- revision=revision,
713
- cache_dir=cache_dir,
714
- force_download=force_download,
715
- token=token,
716
- local_files_only=local_files_only,
717
- )
718
- with open(config_file, "r") as f:
719
- saved_n_outputs = json.load(f).get("n_outputs")
720
- except (OSError, json.JSONDecodeError, KeyError):
721
- pass # config unavailable; skip reset_head logic
722
-
723
- requested_n_outputs = model_kwargs.get("n_outputs")
724
-
725
- # If the user requests different n_outputs, load with the
726
- # saved value first (so weights match), then swap the head.
727
- if (
728
- saved_n_outputs is not None
729
- and requested_n_outputs is not None
730
- and requested_n_outputs != saved_n_outputs
731
- ):
732
- model_kwargs["n_outputs"] = saved_n_outputs
733
-
734
- # If a custom filename is provided, temporarily override the
735
- # HuggingFace constant so the parent class downloads the
736
- # correct file (e.g. "LUNA_base.safetensors" instead of
737
- # "model.safetensors").
738
- hf_constants = huggingface_hub.constants
739
- _orig_safetensors = hf_constants.SAFETENSORS_SINGLE_FILE
740
- if filename is not None:
741
- hf_constants.SAFETENSORS_SINGLE_FILE = filename
742
- try:
743
- model = super()._from_pretrained( # type: ignore
744
- model_id=model_id,
745
- revision=revision,
746
- cache_dir=cache_dir,
747
- force_download=force_download,
748
- local_files_only=local_files_only,
749
- token=token,
750
- map_location=map_location,
751
- strict=strict,
752
- **model_kwargs,
753
- )
754
- finally:
755
- hf_constants.SAFETENSORS_SINGLE_FILE = _orig_safetensors
756
-
757
- if (
758
- saved_n_outputs is not None
759
- and requested_n_outputs is not None
760
- and requested_n_outputs != saved_n_outputs
761
- ):
762
- try:
763
- model.reset_head(requested_n_outputs)
764
- except NotImplementedError:
765
- raise ValueError(
766
- f"{type(model).__name__} does not support changing "
767
- f"n_outputs after loading. Saved model has "
768
- f"n_outputs={saved_n_outputs}, but "
769
- f"n_outputs={requested_n_outputs} was requested."
770
- ) from None
771
-
772
- return model
584
+ return super()._from_pretrained( # type: ignore
585
+ model_id=model_id,
586
+ revision=revision,
587
+ cache_dir=cache_dir,
588
+ force_download=force_download,
589
+ local_files_only=local_files_only,
590
+ token=token,
591
+ map_location=map_location,
592
+ strict=strict,
593
+ **model_kwargs,
594
+ )
@@ -291,23 +291,15 @@ class BENDR(EEGModuleMixin, nn.Module):
291
291
  else:
292
292
  in_features = encoder_h
293
293
 
294
- self._head_in_features = in_features
295
294
  self.final_layer = None
296
295
  if self.include_final_layer:
297
- self._build_head(self.n_outputs)
298
-
299
- def _build_head(self, n_outputs):
300
- linear = nn.Linear(in_features=self._head_in_features, out_features=n_outputs)
301
- self.final_layer = nn.utils.parametrizations.weight_norm(
302
- linear, name="weight", dim=1
303
- )
304
-
305
- def reset_head(self, n_outputs):
306
- self._n_outputs = n_outputs
307
- self.include_final_layer = True
308
- self._build_head(n_outputs)
296
+ # in_features: encoder_h*4 (encoder_only) or encoder_h (full model)
297
+ linear = nn.Linear(in_features=in_features, out_features=self.n_outputs)
298
+ self.final_layer = nn.utils.parametrizations.weight_norm(
299
+ linear, name="weight", dim=1
300
+ )
309
301
 
310
- def forward(self, x, return_features=False):
302
+ def forward(self, x):
311
303
  if self.channel_projection is not None:
312
304
  x = self.channel_projection(x)
313
305
  encoded = self.encoder(x)
@@ -336,9 +328,6 @@ class BENDR(EEGModuleMixin, nn.Module):
336
328
  feature = context[:, :, 0]
337
329
  # feature: [batch_size, encoder_h]
338
330
 
339
- if return_features:
340
- return {"features": feature, "cls_token": None}
341
-
342
331
  if self.final_layer is not None:
343
332
  feature = self.final_layer(feature)
344
333
  # feature: [batch_size, n_outputs]
@@ -183,22 +183,13 @@ class BIOT(EEGModuleMixin, nn.Module):
183
183
  attn_layer_dropout=att_layer_drop_prob,
184
184
  )
185
185
 
186
- self._head_activation = activation
187
186
  self.final_layer = _ClassificationHead(
188
187
  emb_size=self.embed_dim,
189
188
  n_outputs=self.n_outputs,
190
189
  activation=activation,
191
190
  )
192
191
 
193
- def reset_head(self, n_outputs):
194
- self._n_outputs = n_outputs
195
- self.final_layer = _ClassificationHead(
196
- emb_size=self.embed_dim,
197
- n_outputs=n_outputs,
198
- activation=self._head_activation,
199
- )
200
-
201
- def forward(self, x, return_features=False):
192
+ def forward(self, x):
202
193
  """
203
194
  Pass the input through the BIOT encoder, and then through the
204
195
  classification head.
@@ -207,24 +198,15 @@ class BIOT(EEGModuleMixin, nn.Module):
207
198
  ----------
208
199
  x: Tensor
209
200
  (batch_size, n_channels, n_times)
210
- return_features : bool
211
- If True, return a dict with ``"features"`` and ``"cls_token"``
212
- instead of the classification output.
213
201
 
214
202
  Returns
215
203
  -------
216
- torch.Tensor or tuple or dict
217
- Default: ``torch.Tensor`` of shape ``(batch_size, n_outputs)``.
218
- If ``return_features=True``: ``dict`` with ``"features"``
219
- ``(batch_size, emb_size)`` and ``"cls_token"`` (``None``).
220
- If legacy ``return_feature=True`` (init param):
221
- ``(out, emb)`` tuple (ignored when ``return_features=True``).
204
+ out: Tensor
205
+ (batch_size, n_outputs)
206
+ (out, emb): tuple Tensor
207
+ (batch_size, n_outputs), (batch_size, emb_size)
222
208
  """
223
209
  emb = self.encoder(x)
224
-
225
- if return_features:
226
- return {"features": emb, "cls_token": None}
227
-
228
210
  x = self.final_layer(emb)
229
211
 
230
212
  if self.return_feature: