bruAristimunha commited on
Commit
fad3523
·
verified ·
1 Parent(s): 3c92433

Initial deploy: tutorial index (notebooks pending make html)

Browse files
Files changed (1) hide show
  1. README.md +127 -0
README.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-3-clause
3
+ language:
4
+ - en
5
+ tags:
6
+ - eeg
7
+ - biosignal
8
+ - tutorials
9
+ - notebooks
10
+ - braindecode
11
+ - neuroscience
12
+ - brain-computer-interface
13
+ pretty_name: Braindecode Tutorials
14
+ size_categories:
15
+ - n<1K
16
+ ---
17
+
18
+ # Braindecode Tutorials
19
+
20
+ Curated collection of **31 executable Jupyter notebooks** showing how to use
21
+ [braindecode](https://braindecode.org) for end-to-end EEG / biosignal deep
22
+ learning: data loading, preprocessing, model training, fine-tuning of
23
+ foundation models, and Hugging Face Hub integration.
24
+
25
+ > Each notebook is mirrored from the
26
+ > [`examples/`](https://github.com/braindecode/braindecode/tree/master/examples)
27
+ > directory of the upstream repo. They are auto-converted from the
28
+ > sphinx-gallery `.py` source on every release; the canonical rendered
29
+ > versions live at <https://braindecode.org/stable/auto_examples>.
30
+
31
+ ## How to use this dataset repo
32
+
33
+ Three options, in increasing order of convenience:
34
+
35
+ | Option | What you do |
36
+ |---|---|
37
+ | **Open in Colab** | Click any `▶ Colab` link below. Free GPU runtime; no install. |
38
+ | **Download** | `huggingface-cli download braindecode/tutorials --repo-type dataset --local-dir tutorials/` |
39
+ | **Browse rendered HTML** | <https://braindecode.org/stable/auto_examples> (sphinx-gallery output). |
40
+
41
+ Each notebook installs braindecode in the first cell, so it's runnable
42
+ on a fresh kernel.
43
+
44
+ ## Catalogue
45
+
46
+ ### Getting started — datasets & I/O
47
+
48
+ | Notebook | Topic | Run |
49
+ |---|---|---|
50
+ | `plot_moabb_dataset_example.ipynb` | Load a MOABB dataset (BNCI 2014-001) | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_moabb_dataset_example.ipynb) |
51
+ | `plot_mne_dataset_example.ipynb` | Wrap an `mne.io.Raw` as a braindecode dataset | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_mne_dataset_example.ipynb) |
52
+ | `plot_bids_dataset_example.ipynb` | Load a BIDS-formatted EEG dataset | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_bids_dataset_example.ipynb) |
53
+ | `plot_custom_dataset_example.ipynb` | Roll your own dataset class | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_custom_dataset_example.ipynb) |
54
+ | `plot_load_save_datasets.ipynb` | Cache datasets to disk and reload them | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_load_save_datasets.ipynb) |
55
+ | `plot_split_dataset.ipynb` | Train/valid/test splits at session and subject level | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_split_dataset.ipynb) |
56
+ | `plot_benchmark_preprocessing.ipynb` | Compare preprocessing strategies head-to-head | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_benchmark_preprocessing.ipynb) |
57
+ | `plot_tuh_discrete_multitarget.ipynb` | TUH multi-target discrete labels | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_tuh_discrete_multitarget.ipynb) |
58
+ | `plot_hub_integration.ipynb` | Push / pull braindecode datasets to the Hub | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/datasets_io/plot_hub_integration.ipynb) |
59
+
60
+ ### Model building & training
61
+
62
+ | Notebook | Topic | Run |
63
+ |---|---|---|
64
+ | `plot_basic_training_epochs.ipynb` | Train any braindecode model in a few cells | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_basic_training_epochs.ipynb) |
65
+ | `plot_train_in_pure_pytorch_and_pytorch_lightning.ipynb` | Pure-PyTorch and Lightning training loops | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_train_in_pure_pytorch_and_pytorch_lightning.ipynb) |
66
+ | `plot_bcic_iv_2a_moabb_trial.ipynb` | BCI Competition IV 2a — trial-wise decoding | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_bcic_iv_2a_moabb_trial.ipynb) |
67
+ | `plot_bcic_iv_2a_moabb_cropped.ipynb` | BCI Competition IV 2a — cropped decoding | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_bcic_iv_2a_moabb_cropped.ipynb) |
68
+ | `plot_bcic_iv_2a_eegprep_cleaning.ipynb` | EEG-Prep cleaning before training | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_bcic_iv_2a_eegprep_cleaning.ipynb) |
69
+ | `plot_load_pretrained_models.ipynb` | **Load BENDR / BIOT / EEGPT from the Hub and fine-tune** | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_load_pretrained_models.ipynb) |
70
+ | `plot_how_train_test_and_tune.ipynb` | Cross-validation and hyper-parameter tuning | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_how_train_test_and_tune.ipynb) |
71
+ | `plot_hyperparameter_tuning_with_scikit-learn.ipynb` | scikit-learn `GridSearchCV` over braindecode | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_hyperparameter_tuning_with_scikit-learn.ipynb) |
72
+ | `plot_preprocessing_classes.ipynb` | The `Preprocessor` API | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_preprocessing_classes.ipynb) |
73
+ | `plot_channel_interpolation.ipynb` | Bad-channel interpolation | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_channel_interpolation.ipynb) |
74
+ | `plot_regression.ipynb` | EEG regression instead of classification | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/model_building/plot_regression.ipynb) |
75
+
76
+ ### Advanced training
77
+
78
+ | Notebook | Topic | Run |
79
+ |---|---|---|
80
+ | `plot_data_augmentation.ipynb` | EEG-specific augmentations | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_data_augmentation.ipynb) |
81
+ | `plot_data_augmentation_search.ipynb` | Search over augmentation policies | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_data_augmentation_search.ipynb) |
82
+ | `plot_relative_positioning.ipynb` | Self-supervised pretext tasks | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_relative_positioning.ipynb) |
83
+ | `plot_temporal_generalization.ipynb` | Temporal-generalisation matrices | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_temporal_generalization.ipynb) |
84
+ | `plot_finetune_foundation_model.ipynb` | Fine-tune a Hub foundation model end-to-end | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_finetune_foundation_model.ipynb) |
85
+ | `plot_moabb_benchmark.ipynb` | Run a full MOABB benchmark | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_moabb_benchmark.ipynb) |
86
+ | `plot_exca_config.ipynb` | Reproducible experiments with `exca` | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/advanced_training/plot_exca_config.ipynb) |
87
+
88
+ ### Applied examples
89
+
90
+ | Notebook | Topic | Run |
91
+ |---|---|---|
92
+ | `plot_sleep_staging_chambon2018.ipynb` | Sleep staging with Chambon2018 | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/applied_examples/plot_sleep_staging_chambon2018.ipynb) |
93
+ | `plot_sleep_staging_usleep.ipynb` | Sleep staging with U-Sleep | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/applied_examples/plot_sleep_staging_usleep.ipynb) |
94
+ | `plot_sleep_staging_eldele2021.ipynb` | Sleep staging with Eldele2021 | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/applied_examples/plot_sleep_staging_eldele2021.ipynb) |
95
+ | `plot_tuh_eeg_corpus.ipynb` | Working with the TUH EEG corpus | [▶ Colab](https://colab.research.google.com/github/braindecode/braindecode/blob/master/examples/applied_examples/plot_tuh_eeg_corpus.ipynb) |
96
+
97
+ ## How the notebooks are produced
98
+
99
+ Sphinx-gallery automatically generates a `.ipynb` next to each rendered
100
+ HTML page during the docs build. The conversion script for this
101
+ dataset repo simply collects those generated notebooks:
102
+
103
+ ```bash
104
+ # in the braindecode repo
105
+ cd docs && make html # builds HTML + .ipynb files
106
+ python ../hf_assets/tutorials_index/build_notebooks.py # gathers .ipynb
107
+ ```
108
+
109
+ See `build_notebooks.py` for the gather + push logic.
110
+
111
+ ## Cost note
112
+
113
+ Hosting `.ipynb` files in a public dataset repo is **free** on Hugging
114
+ Face. Compute (Colab) is also free for the small datasets used in these
115
+ tutorials. No paid tier is required.
116
+
117
+ ## Citation
118
+
119
+ ```bibtex
120
+ @article{aristimunha2025braindecode,
121
+ title = {Braindecode: a deep learning library for raw electrophysiological data},
122
+ author = {Aristimunha, Bruno and others},
123
+ journal = {Zenodo},
124
+ year = {2025},
125
+ doi = {10.5281/zenodo.17699192},
126
+ }
127
+ ```