braindecode.augmentation.functional.mixup#

braindecode.augmentation.functional.mixup(X, y, lam, idx_perm)[source]#

Mixes two channels of EEG data.

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

Parameters
  • X (torch.Tensor) – EEG data in form batch_size, n_channels, n_times

  • y (torch.Tensor) – Target of length batch_size

  • lam (torch.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

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.

Return type

tuple

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

facebookresearch/mixup-cifar10