MIXUP#

Functions#

utils.mixup.mixup(couples, alpha, force_lambda=None)[source]#

Applies mixup augmentation to the given couples of inputs.

Parameters:
  • couples (list) – A list of tuples, where each tuple contains two inputs to be mixed.

  • alpha (float) – The alpha parameter for the Beta distribution used to sample the mixing coefficients.

  • force_lambda (float or None, optional) – If not None, forces the use of a specific mixing coefficient for all inputs.

Returns:

If more than one mixed input is generated, a tuple of mixed inputs is returned. Otherwise, a single mixed input is returned.

Return type:

tuple or torch.Tensor