braindecode.augmentation.functional.label_smoothing#
- braindecode.augmentation.functional.label_smoothing(X, y, epsilon, num_classes=None)[source]#
Smooth targets toward the uniform distribution over the classes.
See [1] for details.
- Parameters:
X (
Tensor) – EEG data in formbatch_size, n_channels, n_times. Returned unchanged.y (
Tensor) – Target of lengthbatch_sizeholding class indices (float values are accepted when they are integral), or a floating-point tensor of shapebatch_size, num_classesholding target distributions.epsilon (
float) – Smoothing parameter between 0 and 1: the weight of the uniform distribution mixed into the targets.0returns the unsmoothed targets.num_classes (
int|None) – Number of classes. Required whenyholds class indices; whenyalready holds distributions, it must match the size of the last dimension ofy. Defaults to None.
- Returns:
X,y. WhereXis unchanged andyis a floating-point tensor of shapebatch_size, num_classeswhose rows sum to one.- Return type:
References
[1]Christian Szegedy, Vincent Vanhoucke, Jonathon Shlens and Zbigniew Wojna (2016). Rethinking the Inception Architecture for Computer Vision. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818-2826. Online: https://arxiv.org/abs/1512.00567