ott.tools.unreg.wassdis_p

Contents

ott.tools.unreg.wassdis_p#

ott.tools.unreg.wassdis_p(x, y, p=2.0)[source]#

Compute the Wasserstein distance, uses Hungarian algorithm.

Uses hungarian() to solve the optimal matching problem between two point clouds of the same size, to compute a Wasserstein distance estimator.

Note

At the moment, only supports point clouds of the same size to be easily cast as an optimal matching problem.

Parameters:
  • x (Array) – [n,d] point cloud

  • y (Array) – [n,d] point cloud of the same size

  • p (float) – order of the Wasserstein distance, non-negative float.

Return type:

float

Returns:

The p-Wasserstein distance between these point clouds.hungarian