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
:
|
Shallow ConvNet model from Schirrmeister et al 2017. |
|
Deep ConvNet model from Schirrmeister et al 2017. |
|
Sleep staging architecture from Supratak et al 2017. |
|
EEG Conformer. |
|
EEG Inception for ERP-based classification |
|
EEG Inception for ERP-based classification |
|
EEG Inception for Motor Imagery, as proposed in [Rc36ed781f4f5-1] |
|
ATCNet model from [R2ecdb73d6ab9-1] |
|
EEG-ITNet: An Explainable Inception Temporal |
|
EEGNet model from Lawhern et al. 2016. |
|
EEGNet v4 model from Lawhern et al 2018. |
|
Hybrid ConvNet model from Schirrmeister et al 2017. |
|
Residual Network for EEG. |
|
Temporal Convolutional Network (TCN) from Bai et al 2018. |
|
Sleep staging architecture from Chambon et al 2018. |
|
Sleep staging architecture from Blanco et al 2020. |
|
Sleep Staging Architecture from Eldele et al 2021. |
|
Sleep staging architecture from Perslev et al 2021. |
|
Thinker Invariance DenseNet model from Kostas et al 2020. |
|
Returns shape of neural network output for batch size equal 1. |
|
Apply module on multiple windows. |
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. |
|
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. |
|
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. |
|
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. |
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]. |