- braindecode.training.mixup_criterion(preds, target)[source]#
Implements loss for Mixup for EEG data. See .
Implementation based on .
preds (torch.Tensor) – Predictions from the model.
target (torch.Tensor | list of torch.Tensor) – For predictions without mixup, the targets as a tensor. If mixup has been applied, a list containing the targets of the two mixed samples and the mixing coefficients as tensors.
loss – The loss value.
- Return type
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, David Lopez-Paz mixup: Beyond Empirical Risk Minimization Online: https://arxiv.org/abs/1710.09412