API Reference#
This is the reference for classes (CamelCase
names) and functions
(underscore_case
names) of Braindecode.
Classifier#
braindecode.classifier
:
|
Classifier that does not assume softmax activation. |
Regressor#
braindecode.regressor
:
|
Regressor that calls loss function directly. |
Models#
braindecode.models.base
:
|
Mixin class for all EEG models in braindecode. |
braindecode.models
:
|
ATCNet model from Altaheri et al. (2022) [R2ecdb73d6ab9-1]. |
|
AttentionBaseNet from Wimpff M et al. (2023) [R523d6c831d64-Martin2023]. |
|
Braindecode TCN from Gemein, L et al (2020) [Rd56781dc6fcb-gemein2020]. |
|
BIOT from Yang et al. (2023) [R606e26b38fe6-Yang2023]. |
|
Contrast with the World Representation ContraWR from Yang et al (2021) [Ra71465cb6797-Yang2021]. |
|
CTNet from Zhao, W et al (2024) [Rc7f1d6cec70c-ctnet]. |
|
Deep ConvNet model from Schirrmeister et al (2017) [Rb8ef6c2733ce-Schirrmeister2017]. |
|
Sleep staging architecture from Supratak et al. (2017) [R28b528aca953-Supratak2017]. |
|
EEG Conformer from Song et al. (2022) from [Rd6c0fefc356a-song2022]. |
|
EEG Inception for ERP-based from Santamaria-Vazquez et al (2020) [R37c4761d4e92-santamaria2020]. |
|
EEG Inception for Motor Imagery, as proposed in Zhang et al. (2021) [Rc36ed781f4f5-1]. |
|
EEG-ITNet from Salami, et al (2022) [R7fe571f46200-Salami2022] |
|
EEGNet model from Lawhern et al. 2016 from [Rcbe3da2652d4-EEGNet]. |
|
EEGNet v4 model from Lawhern et al. (2018) [Rbd7837e27d7f-EEGNet4]. |
|
EEGNeX model from Chen et al. (2024) [R60f8df15fd80-eegnex]. |
|
EEGMiner from Ludwig et al (2024) [R66a8789ab6ed-eegminer]. |
|
EEGResNet from Schirrmeister et al. 2017 [R625b4a01fbf7-Schirrmeister2017]. |
|
EEGSimpleConv from Ouahidi, YE et al. (2023) [R5661533ddc63-Yassine2023]. |
|
EEGTCNet model from Ingolfsson et al. (2020) [Rc25b3d8a3a40-ingolfsson2020]. |
|
Labram from Jiang, W B et al (2024) [Rb5cdfc6ea4fe-Jiang2024]. |
|
MSVTNet model from Liu K et al (2024) from [R0733e66fed6d-msvt2024]. |
|
SCCNet from Wei, C S (2019) [Rbd95e5cdbbde-sccnet]. |
|
Sinc-ShallowNet from Borra, D et al (2020) [R4fd1ba6a7153-borra2020]. |
|
Shallow ConvNet model from Schirrmeister et al (2017) [R9432a19f6121-Schirrmeister2017]. |
|
Sleep staging architecture from Blanco et al. (2020) from [Rb3eee9d9e81a-Blanco2020]. |
|
Sleep staging architecture from Chambon et al. (2018) [R89163c5eab6a-Chambon2018]. |
|
Sleep Staging Architecture from Eldele et al. (2021) [R63c3502458ce-Eldele2021]. |
|
Seizures, Periodic and Rhythmic pattern Continuum Neural Network (SPaRCNet) from Jing et al. (2023) [Rf8eed20f8ca2-jing2023]. |
|
Synchronization Network (SyncNet) from Li, Y et al (2017) [R5cdbe961b734-Li2017]. |
|
TSception model from Ding et al. (2020) from [R422d465e7195-ding2020]. |
|
Thinker Invariance DenseNet model from Kostas et al. (2020) [Re74dd80418c9-TIDNet]. |
|
Sleep staging architecture from Perslev et al. (2021) [R58a5e8182f0a-1]. |
braindecode.models
:
|
Apply multiple band-pass filters to generate multiview signal representation. |
|
Generalized Gaussian Filter from Ludwig et al (2024) [R9d2e5f5ce220-eegminer]. |
Training#
braindecode.training
:
|
Compute Loss after averaging predictions across time. |
|
Compute Loss between timeseries targets and predictions. |
|
Class to compute scores for trials from a model that predicts (super)crops. |
|
Class to compute scores for trials from a model that predicts (super)crops with time series target. |
|
Epoch Scoring class that recomputes predictions after the epoch on the training in validation mode. |
|
Implements loss for Mixup for EEG data. |
|
Assigning window predictions to trials while removing duplicate predictions. |
|
Create trialwise predictions and optionally also return trialwise labels from cropped dataset given module. |
Datasets#
braindecode.datasets
:
|
Returns samples from an mne.io.Raw object along with a target. |
|
A base class for concatenated datasets. |
|
Returns windows from an mne.Epochs object along with a target. |
|
A class for moabb datasets. |
|
High-gamma dataset described in Schirrmeister et al. 2017. |
|
BNCI 2014-001 Motor Imagery dataset. |
|
Temple University Hospital (TUH) EEG Corpus (www.isip.piconepress.com/projects/tuh_eeg/html/downloads.shtml#c_tueg). |
|
Temple University Hospital (TUH) Abnormal EEG Corpus. |
|
The NMT Scalp EEG Dataset. |
|
Sleep Physionet dataset. |
|
BCI competition IV dataset 4. |
|
Create a BaseConcatDataset of WindowsDatasets from X and y to be used for decoding with skorch and braindecode, where X is a list of pre-cut trials and y are corresponding targets. |
|
Create WindowsDatasets from mne.RawArrays |
|
Create WindowsDatasets from mne.Epochs |
Preprocessing#
braindecode.preprocessing
:
|
Create windows based on events in mne.Raw. |
|
Windower that creates sliding windows. |
|
|
|
Perform exponential moving demeanining. |
|
Perform exponential moving standardization. |
|
Applies multiple bandpass filters to the signals in raw. |
|
Apply preprocessors to a concat dataset. |
|
Preprocessor for an MNE Raw or Epochs object. |
|
Resample an array. |
|
Drop channel(s). |
|
Specify which reference to use for EEG data. |
|
Filter a subset of channels/vertices. |
|
Pick a subset of channels. |
|
Crop raw data file. |
Data Utils#
braindecode.datautil
:
|
|
|
Load a stored BaseConcatDataset of BaseDatasets or WindowsDatasets from files. |
Samplers#
braindecode.samplers
:
|
Base sampler simplifying sampling from recordings. |
|
Sample sequences of consecutive windows. |
|
Sample examples for the relative positioning task from [R0467437a2408-Banville2020]. |
|
Balanced sampling of sequences of consecutive windows with categorical targets. |
Augmentation#
braindecode.augmentation
:
|
Basic transform class used for implementing data augmentation operations. |
|
Identity transform. |
|
Transform composition. |
|
A base dataloader class customized to applying augmentation Transforms. |
|
Flip the time axis of each input with a given probability. |
|
Flip the sign axis of each input with a given probability. |
|
FT surrogate augmentation of a single EEG channel, as proposed in [Ra7c6c14d9bd9-1]. |
|
Randomly shuffle channels in EEG data matrix. |
|
Randomly set channels to flat signal. |
|
Randomly add white noise to all channels. |
|
Permute EEG channels inverting left and right-side sensors. |
|
Smoothly replace a randomly chosen contiguous part of all channels by zeros. |
|
Apply a band-stop filter with desired bandwidth at a randomly selected frequency position between 0 and |
|
Add a random shift in the frequency domain to all channels. |
|
Interpolates EEG signals over sensors rotated around the desired axis with an angle sampled uniformly between |
|
Interpolates EEG signals over sensors rotated around the Z axis with an angle sampled uniformly between |
|
Interpolates EEG signals over sensors rotated around the Y axis with an angle sampled uniformly between |
|
Interpolates EEG signals over sensors rotated around the X axis with an angle sampled uniformly between |
|
Implements Iterator for Mixup for EEG data. |
|
Segmentation Reconstruction from Lotte (2015) [R78e7a66c7d6f-Lotte2015]. |
|
MaskEncoding from [R9102599ed233-1]. |
|
Identity operation. |
|
Flip the time axis of each input. |
|
Flip the sign axis of each input. |
|
FT surrogate augmentation of a single EEG channel, as proposed in [R52a4658fffa7-1]. |
|
Randomly set channels to flat signal. |
|
Randomly shuffle channels in EEG data matrix. |
|
Permute EEG channels according to fixed permutation matrix. |
|
Randomly add white Gaussian noise to all channels. |
|
Smoothly replace a contiguous part of all channels by zeros. |
|
Apply a band-stop filter with desired bandwidth at the desired frequency position. |
|
Adds a shift in the frequency domain to all channels. |
|
Interpolates EEG signals over sensors rotated around the desired axis with the desired angle. |
|
Mixes two channels of EEG data. |
|
Segment and reconstruct EEG data from [Rc19448ba78ac-1]. |
|
Mark encoding from Ding et al. (2024) from [Re49696d5b28b-ding2024]. |
Utils#
braindecode.util
:
|
Set seeds for python random module numpy.random and torch. |
Visualization#
braindecode.visualization
:
|
|
|
Generates a confusion matrix with additional precision and sensitivity metrics as in [R8046536b33dd-1]. |