@@ -36,7 +36,8 @@ def test_emd_emd2():
3636
3737 # check loss=0
3838 assert np .allclose (w , 0 )
39-
39+
40+
4041def test_emd2_multi ():
4142
4243 from ot .datasets import get_1D_gauss as gauss
@@ -72,11 +73,11 @@ def test_emd2_multi():
7273 emdn = ot .emd2 (a , b , M )
7374 ot .toc ('multi proc : {} s' )
7475
75- assert np .allclose (emd1 , emdn )
76-
77-
76+ assert np .allclose (emd1 , emdn )
77+
78+
7879def test_sinkhorn ():
79- # test sinkhorn
80+ # test sinkhorn
8081 n = 100
8182 np .random .seed (0 )
8283
@@ -85,14 +86,15 @@ def test_sinkhorn():
8586
8687 M = ot .dist (x , x )
8788
88- G = ot .sinkhorn (u , u , M ,1 , stopThr = 1e-10 )
89+ G = ot .sinkhorn (u , u , M , 1 , stopThr = 1e-10 )
8990
9091 # check constratints
91- assert np .allclose (u , G .sum (1 ), atol = 1e-05 ) # cf convergence sinkhorn
92- assert np .allclose (u , G .sum (0 ), atol = 1e-05 ) # cf convergence sinkhorn
93-
92+ assert np .allclose (u , G .sum (1 ), atol = 1e-05 ) # cf convergence sinkhorn
93+ assert np .allclose (u , G .sum (0 ), atol = 1e-05 ) # cf convergence sinkhorn
94+
95+
9496def test_sinkhorn_variants ():
95- # test sinkhorn
97+ # test sinkhorn
9698 n = 100
9799 np .random .seed (0 )
98100
@@ -101,11 +103,11 @@ def test_sinkhorn_variants():
101103
102104 M = ot .dist (x , x )
103105
104- G0 = ot .sinkhorn (u , u , M ,1 , method = 'sinkhorn' ,stopThr = 1e-10 )
105- Gs = ot .sinkhorn (u , u , M ,1 , method = 'sinkhorn_stabilized' ,stopThr = 1e-10 )
106- Ges = ot .sinkhorn (u , u , M ,1 , method = 'sinkhorn_epsilon_scaling' ,stopThr = 1e-10 )
106+ G0 = ot .sinkhorn (u , u , M , 1 , method = 'sinkhorn' , stopThr = 1e-10 )
107+ Gs = ot .sinkhorn (u , u , M , 1 , method = 'sinkhorn_stabilized' , stopThr = 1e-10 )
108+ Ges = ot .sinkhorn (
109+ u , u , M , 1 , method = 'sinkhorn_epsilon_scaling' , stopThr = 1e-10 )
107110
108111 # check constratints
109- assert np .allclose (G0 , Gs , atol = 1e-05 )
110- assert np .allclose (G0 , Ges , atol = 1e-05 ) #
111-
112+ assert np .allclose (G0 , Gs , atol = 1e-05 )
113+ assert np .allclose (G0 , Ges , atol = 1e-05 )
0 commit comments