@@ -57,6 +57,7 @@ def test_stochastic_sag():
57
57
# 2 identical discrete measures u defined on the same space with a
58
58
# regularization term, a learning rate and a number of iteration
59
59
60
+
60
61
def test_stochastic_asgd ():
61
62
# test asgd
62
63
n = 15
@@ -134,9 +135,9 @@ def test_sag_asgd_sinkhorn():
134
135
# 2 identical discrete measures u defined on the same space with a
135
136
# regularization term, a batch_size and a number of iteration
136
137
138
+
137
139
def test_stochastic_dual_sgd ():
138
140
# test sgd
139
- print ("SGD" )
140
141
n = 10
141
142
reg = 1
142
143
numItermax = 300000
@@ -157,6 +158,7 @@ def test_stochastic_dual_sgd():
157
158
np .testing .assert_allclose (
158
159
u , G .sum (0 ), atol = 1e-02 ) # cf convergence sgd
159
160
161
+
160
162
#############################################################################
161
163
#
162
164
# TEST Convergence SGD toward Sinkhorn's solution
@@ -167,7 +169,6 @@ def test_stochastic_dual_sgd():
167
169
168
170
def test_dual_sgd_sinkhorn ():
169
171
# test all dual algorithms
170
- print ("SGD vs Sinkhorn" )
171
172
n = 10
172
173
reg = 1
173
174
nb_iter = 300000
@@ -191,8 +192,3 @@ def test_dual_sgd_sinkhorn():
191
192
zero , (G_sgd - G_sinkhorn ).sum (0 ), atol = 1e-02 ) # cf convergence sgd
192
193
np .testing .assert_allclose (
193
194
G_sgd , G_sinkhorn , atol = 1e-02 ) # cf convergence sgd
194
-
195
-
196
- if __name__ == '__main__' :
197
- test_stochastic_dual_sgd ()
198
- test_dual_sgd_sinkhorn ()
0 commit comments