From 53b063ed6b6aa15d6cb103a9304bbd169678b2e9 Mon Sep 17 00:00:00 2001 From: Rémi Flamary Date: Fri, 24 Apr 2020 12:39:38 +0200 Subject: better coverage options verbose and log --- test/test_stochastic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_stochastic.py') diff --git a/test/test_stochastic.py b/test/test_stochastic.py index f0f3fc8..8ddf485 100644 --- a/test/test_stochastic.py +++ b/test/test_stochastic.py @@ -70,8 +70,8 @@ def test_stochastic_asgd(): M = ot.dist(x, x) - G = ot.stochastic.solve_semi_dual_entropic(u, u, M, reg, "asgd", - numItermax=numItermax) + G, log = ot.stochastic.solve_semi_dual_entropic(u, u, M, reg, "asgd", + numItermax=numItermax, log=True) # check constratints np.testing.assert_allclose( @@ -145,8 +145,8 @@ def test_stochastic_dual_sgd(): M = ot.dist(x, x) - G = ot.stochastic.solve_dual_entropic(u, u, M, reg, batch_size, - numItermax=numItermax) + G, log = ot.stochastic.solve_dual_entropic(u, u, M, reg, batch_size, + numItermax=numItermax, log=True) # check constratints np.testing.assert_allclose( -- cgit v1.2.3 From 90bd408e86eccb03b02d57a0cd7963e0c848a1fc Mon Sep 17 00:00:00 2001 From: Rémi Flamary Date: Fri, 24 Apr 2020 13:59:42 +0200 Subject: pep8 --- test/test_partial.py | 5 ++--- test/test_stochastic.py | 4 ++-- test/test_unbalanced.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'test/test_stochastic.py') diff --git a/test/test_partial.py b/test/test_partial.py index 5960e4e..b533a9c 100755 --- a/test/test_partial.py +++ b/test/test_partial.py @@ -9,6 +9,7 @@ import numpy as np import scipy as sp import ot + def test_partial_wasserstein_lagrange(): n_samples = 20 # nb samples (gaussian) @@ -29,9 +30,7 @@ def test_partial_wasserstein_lagrange(): m = 0.5 - w0, log0 = ot.partial.partial_wasserstein_lagrange(p, q, M, 1, log=True) - - + w0, log0 = ot.partial.partial_wasserstein_lagrange(p, q, M, 1, log=True) def test_partial_wasserstein(): diff --git a/test/test_stochastic.py b/test/test_stochastic.py index 8ddf485..155622c 100644 --- a/test/test_stochastic.py +++ b/test/test_stochastic.py @@ -71,7 +71,7 @@ def test_stochastic_asgd(): M = ot.dist(x, x) G, log = ot.stochastic.solve_semi_dual_entropic(u, u, M, reg, "asgd", - numItermax=numItermax, log=True) + numItermax=numItermax, log=True) # check constratints np.testing.assert_allclose( @@ -146,7 +146,7 @@ def test_stochastic_dual_sgd(): M = ot.dist(x, x) G, log = ot.stochastic.solve_dual_entropic(u, u, M, reg, batch_size, - numItermax=numItermax, log=True) + numItermax=numItermax, log=True) # check constratints np.testing.assert_allclose( diff --git a/test/test_unbalanced.py b/test/test_unbalanced.py index d5bae42..dfeaad9 100644 --- a/test/test_unbalanced.py +++ b/test/test_unbalanced.py @@ -35,7 +35,7 @@ def test_unbalanced_convergence(method): verbose=True) loss = ot.unbalanced.sinkhorn_unbalanced2(a, b, M, epsilon, reg_m, method=method, - verbose=True) + verbose=True) # check fixed point equations # in log-domain fi = reg_m / (reg_m + epsilon) -- cgit v1.2.3