@@ -74,40 +74,3 @@ def test_emd2_multi():
74
74
ot .toc ('multi proc : {} s' )
75
75
76
76
assert np .allclose (emd1 , emdn )
77
-
78
-
79
- def test_sinkhorn ():
80
- # test sinkhorn
81
- n = 100
82
- np .random .seed (0 )
83
-
84
- x = np .random .randn (n , 2 )
85
- u = ot .utils .unif (n )
86
-
87
- M = ot .dist (x , x )
88
-
89
- G = ot .sinkhorn (u , u , M , 1 , stopThr = 1e-10 )
90
-
91
- # check constratints
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
-
96
- def test_sinkhorn_variants ():
97
- # test sinkhorn
98
- n = 100
99
- np .random .seed (0 )
100
-
101
- x = np .random .randn (n , 2 )
102
- u = ot .utils .unif (n )
103
-
104
- M = ot .dist (x , x )
105
-
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 )
110
-
111
- # check constratints
112
- assert np .allclose (G0 , Gs , atol = 1e-05 )
113
- assert np .allclose (G0 , Ges , atol = 1e-05 )
0 commit comments