braindecode.training.CroppedLoss#
- class braindecode.training.CroppedLoss(loss_function)[source]#
Compute Loss after averaging predictions across time. Assumes predictions are in shape: n_batch size x n_classes x n_predictions (in time)
Methods
- forward(preds, targets)[source]#
Forward pass.
- Parameters:
preds (torch.Tensor) – Model’s prediction with shape (batch_size, n_classes, n_times).
targets (torch.Tensor) – Targets with shape (batch_size,), or (batch_size, n_classes) for regression. Mixup’s
(y_a, y_b, lam)is passed toloss_functionas is.
Examples using braindecode.training.CroppedLoss#
Convolutional neural network regression model on fake data.
Convolutional neural network regression model on fake data.
Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset
Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset