API Reference

This is the reference for classes (CamelCase names) and functions (underscore_case names) of Braindecode.




EEGClassifier(*args[, cropped, callbacks, …])

Classifier that does not assume softmax activation.



EEGRegressor(*args[, cropped, callbacks, …])

Regressor that calls loss function directly.



ShallowFBCSPNet(in_chans, n_classes[, …])

Shallow ConvNet model from [R9432a19f6121-2].

Deep4Net(in_chans, n_classes, …[, …])

Deep ConvNet model from [Rb8ef6c2733ce-1].

EEGNetv1(in_chans, n_classes[, …])

EEGNet model from [Rcbe3da2652d4-EEGNet].

EEGNetv4(in_chans, n_classes[, …])

EEGNet v4 model from [Rbd7837e27d7f-EEGNet4].

HybridNet(in_chans, n_classes, …)

Hybrid ConvNet model from [R4d1af390a17e-3].

EEGResNet(in_chans, n_classes, …[, …])

Residual Network for EEG.

TCN(n_in_chans, n_outputs, n_blocks, …)

Temporal Convolutional Network (TCN) as described in [Rcfca6ae7a220-1]. Code adapted from https://github.com/locuslab/TCN/blob/master/TCN/tcn.py Parameters ———- n_in_chans: int number of input EEG channels n_outputs: int number of outputs of the decoding task (for example number of classes in classification) n_filters: int number of output filters of each convolution n_blocks: int number of temporal blocks in the network kernel_size: int kernel size of the convolutions drop_prob: float dropout probability add_log_softmax: bool whether to add a log softmax layer References ———- .. [Rcfca6ae7a220-1] Bai, S., Kolter, J. Z., & Koltun, V. (2018). An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271.




Compute Loss after averaging predictions across time.

CroppedTrialEpochScoring(scoring[, …])

Class to compute scores for trials from a model that predicts (super)crops.

PostEpochTrainScoring(scoring[, …])

Epoch Scoring class that recomputes predictions after the epoch on the training in validation mode.

trial_preds_from_window_preds(preds, …)

Assigning window predictions to trials while removing duplicate predictions.



BaseDataset(raw[, description, target_name, …])

Returns samples from an mne.io.Raw object along with a target.


A base class for concatenated datasets.

WindowsDataset(windows[, description, transform])

Returns windows from an mne.Epochs object along with a target.

MOABBDataset(dataset_name, subject_ids)

A class for moabb datasets.

Data Utils


create_from_X_y(X, y, drop_last_window[, …])

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_from_mne_raw(raws, …[, …])

Create WindowsDatasets from mne.RawArrays

create_from_mne_epochs(list_of_epochs, …)

Create WindowsDatasets from mne.Epochs

create_fixed_length_windows(concat_ds, …)

Windower that creates sliding windows.

create_windows_from_events(concat_ds, …[, …])

Create windows based on events in mne.Raw.

exponential_moving_demean(data[, …])

Perform exponential moving demeanining.

exponential_moving_standardize(data[, …])

Perform exponential moving standardization.


Zscore normalize continuous or windowed data in-place.

scale(data, factor)

Scale continuous or windowed data in-place

filterbank(raw, frequency_bands[, …])

Applies multiple bandpass filters to the signals in raw.

save_concat_dataset(path, concat_dataset[, …])

Save a BaseConcatDataset of BaseDatasets or WindowsDatasets to files

load_concat_dataset(path, preload[, …])

Load a stored BaseConcatDataset of BaseDatasets or WindowsDatasets from files



set_random_seeds(seed, cuda)

Set seeds for python random module numpy.random and torch.