braindecode.augmentation.functional.mixup

braindecode.augmentation.functional.mixup(X, y, lam, idx_perm)

Mixes two channels of EEG data.

See [1] for details. Implementation based on [2].

Parameters
Xtorch.Tensor

EEG data in form batch_size, n_channels, n_times

ytorch.Tensor

Target of length batch_size

lamtorch.Tensor

Values between 0 and 1 setting the linear interpolation between examples.

idx_perm: torch.Tensor

Permuted indices of example that are mixed into original examples.

Returns
tuple

X, y. Where X is augmented and y is a tuple of length 3 containing the labels of the two mixed channels and the mixing coefficient.

References

1

Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, David Lopez-Paz (2018). mixup: Beyond Empirical Risk Minimization. In 2018 International Conference on Learning Representations (ICLR) Online: https://arxiv.org/abs/1710.09412

2

https://github.com/facebookresearch/mixup-cifar10/blob/master/train.py