Загрузка
Apply MixUp to the provided batch of images and labels.
Paper: mixup: Beyond Empirical Risk Minimization.
In the input, the labels are expected to be a tensor of shape (batch_size,). They will be transformed
into a tensor of shape (batch_size, num_classes).
alpha (float, optional) – hyperparameter of the Beta distribution used for mixup. Default is 1.
num_classes (int, optional) – number of classes in the batch. Used for one-hot-encoding. Can be None only if the labels are already one-hot-encoded.
labels_getter (callable or "default", optional) – indicates how to identify the labels in the input.
By default, this will pick the second parameter as the labels if it’s a tensor. This covers the most
common scenario where this transform is called as MixUp()(imgs_batch, labels_batch).
It can also be a callable that takes the same input as the transform, and returns the labels.
Examples using MixUp: