summaryrefslogtreecommitdiff
path: root/test/test_gromov.py
diff options
context:
space:
mode:
authorKilian <kilian.fatras@gmail.com>2019-11-13 13:55:24 +0100
committerKilian <kilian.fatras@gmail.com>2019-11-13 13:55:24 +0100
commit2a32e2ea64d0d5096953a9b8259b0507fa58dca5 (patch)
tree1b39bebe41c230a96230953be9e9e79937357d08 /test/test_gromov.py
parent65ca6bfde77dd11d84cbd151fe9ff98454f8e206 (diff)
fix log bug in gromov_wasserstein2
Diffstat (limited to 'test/test_gromov.py')
-rw-r--r--test/test_gromov.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_gromov.py b/test/test_gromov.py
index 70fa83f..43da9fc 100644
--- a/test/test_gromov.py
+++ b/test/test_gromov.py
@@ -44,10 +44,14 @@ def test_gromov():
gw, log = ot.gromov.gromov_wasserstein2(C1, C2, p, q, 'kl_loss', log=True)
+ gw_val = ot.gromov.gromov_wasserstein2(C1, C2, p, q, 'kl_loss', log=False)
+
G = log['T']
np.testing.assert_allclose(gw, 0, atol=1e-1, rtol=1e-1)
+ np.testing.assert_allclose(gw, gw_val, atol=1e-1, rtol=1e-1) # cf log=False
+
# check constratints
np.testing.assert_allclose(
p, G.sum(1), atol=1e-04) # cf convergence gromov