# API Reference¶

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

## Classifier¶

braindecode.classifier:

 EEGClassifier(*args[, cropped, callbacks, …]) Classifier that does not assume softmax activation.

## Regressor¶

braindecode.regressor:

 EEGRegressor(*args[, cropped, callbacks, …]) Regressor that calls loss function directly.

## Models¶

braindecode.models:

 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.

## Training¶

braindecode.training:

 CroppedLoss(loss_function) 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.

## Datasets¶

braindecode.datasets:

 BaseDataset(raw[, description, target_name]) A base dataset holds a mne.Raw, and a pandas.DataFrame with additional description, such as subject_id, session_id, run_id, or age or gender of subjects. BaseConcatDataset(list_of_ds) A base class for concatenated datasets. WindowsDataset(windows[, description]) Applies a windower to a base dataset. MOABBDataset(dataset_name, subject_ids) A class for moabb datasets.

## Data Utils¶

braindecode.datautil:

 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(data) 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

## Utils¶

braindecode.util:

 set_random_seeds(seed, cuda) Set seeds for python random module numpy.random and torch.