deel.lip.losses module

This module contains losses used in wasserstein distance estimation.

deel.lip.losses.HKR_loss(alpha, min_margin=1, true_values=1, - 1)

Wasserstein loss with a regularization param based on hinge loss.

Parameters
  • alpha – regularization factor

  • min_margin – minimal margin ( see hinge_margin_loss )

  • true_values – tuple containing the two label for each predicted class

Returns

a function that compute the regularized Wasserstein loss

deel.lip.losses.KR_loss(true_values=0, 1)

Loss to estimate wasserstein-1 distance using Kantorovich-Rubinstein duality.

Parameters

true_values – tuple containing the two label for each predicted class

Returns

Callable, the function to compute Wasserstein loss

deel.lip.losses.hinge_margin_loss(min_margin=1)

Compute the hinge margin loss.

Parameters

min_margin – the minimal margin to enforce.

Returns

a function that compute the hinge loss

deel.lip.losses.neg_KR_loss(true_values=1, - 1)

Loss to compute the negative wasserstein-1 distance using Kantorovich-Rubinstein duality.

Parameters

true_values – tuple containing the two label for each predicted class

Returns

Callable, the function to compute negative Wasserstein loss