persim.sliced_wasserstein

persim.sliced_wasserstein(PD1, PD2, M=50)[source]

Implementation of Sliced Wasserstein distance as described in Sliced Wasserstein Kernel for Persistence Diagrams by Mathieu Carriere, Marco Cuturi, Steve Oudot (https://arxiv.org/abs/1706.03358)

Parameters:
  • PD1 (np.array size (m,2)) – Persistence diagram
  • PD2 (np.array size (n,2)) – Persistence diagram
  • M (int, default is 50) – Iterations to run approximation.
Returns:

sw (float) – Sliced Wasserstein distance between PD1 and PD2