From ee4934750e8c9dbdee4874d56921aeb9bf7b7bb7 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 31 Oct 2019 08:48:15 +0100 Subject: Increase numItermax in the call to POT. This number is pretty arbitrary... --- src/python/gudhi/wasserstein.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/python/gudhi/wasserstein.py') diff --git a/src/python/gudhi/wasserstein.py b/src/python/gudhi/wasserstein.py index 445772e4..eba7c6d5 100644 --- a/src/python/gudhi/wasserstein.py +++ b/src/python/gudhi/wasserstein.py @@ -92,7 +92,8 @@ def wasserstein_distance(X, Y, p=2., q=2.): # Comptuation of the otcost using the ot.emd2 library. # Note: it is the squared Wasserstein distance. - ot_cost = (n+m) * ot.emd2(a, b, M) + # The default numItermax=100000 is not sufficient for some examples with 5000 points, what is a good value? + ot_cost = (n+m) * ot.emd2(a, b, M, numItermax=2000000) return ot_cost ** (1./p) -- cgit v1.2.3