summaryrefslogtreecommitdiff
path: root/test/test_stochastic.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_stochastic.py')
-rw-r--r--test/test_stochastic.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/test_stochastic.py b/test/test_stochastic.py
index 155622c..98e93ec 100644
--- a/test/test_stochastic.py
+++ b/test/test_stochastic.py
@@ -30,7 +30,7 @@ import ot
def test_stochastic_sag():
# test sag
- n = 15
+ n = 10
reg = 1
numItermax = 30000
rng = np.random.RandomState(0)
@@ -45,9 +45,9 @@ def test_stochastic_sag():
# check constratints
np.testing.assert_allclose(
- u, G.sum(1), atol=1e-04) # cf convergence sag
+ u, G.sum(1), atol=1e-03) # cf convergence sag
np.testing.assert_allclose(
- u, G.sum(0), atol=1e-04) # cf convergence sag
+ u, G.sum(0), atol=1e-03) # cf convergence sag
#############################################################################
@@ -60,9 +60,9 @@ def test_stochastic_sag():
def test_stochastic_asgd():
# test asgd
- n = 15
+ n = 10
reg = 1
- numItermax = 100000
+ numItermax = 10000
rng = np.random.RandomState(0)
x = rng.randn(n, 2)
@@ -75,9 +75,9 @@ def test_stochastic_asgd():
# check constratints
np.testing.assert_allclose(
- u, G.sum(1), atol=1e-03) # cf convergence asgd
+ u, G.sum(1), atol=1e-02) # cf convergence asgd
np.testing.assert_allclose(
- u, G.sum(0), atol=1e-03) # cf convergence asgd
+ u, G.sum(0), atol=1e-02) # cf convergence asgd
#############################################################################
@@ -90,9 +90,9 @@ def test_stochastic_asgd():
def test_sag_asgd_sinkhorn():
# test all algorithms
- n = 15
+ n = 10
reg = 1
- nb_iter = 100000
+ nb_iter = 10000
rng = np.random.RandomState(0)
x = rng.randn(n, 2)
@@ -107,17 +107,17 @@ def test_sag_asgd_sinkhorn():
# check constratints
np.testing.assert_allclose(
- G_sag.sum(1), G_sinkhorn.sum(1), atol=1e-03)
+ G_sag.sum(1), G_sinkhorn.sum(1), atol=1e-02)
np.testing.assert_allclose(
- G_sag.sum(0), G_sinkhorn.sum(0), atol=1e-03)
+ G_sag.sum(0), G_sinkhorn.sum(0), atol=1e-02)
np.testing.assert_allclose(
- G_asgd.sum(1), G_sinkhorn.sum(1), atol=1e-03)
+ G_asgd.sum(1), G_sinkhorn.sum(1), atol=1e-02)
np.testing.assert_allclose(
- G_asgd.sum(0), G_sinkhorn.sum(0), atol=1e-03)
+ G_asgd.sum(0), G_sinkhorn.sum(0), atol=1e-02)
np.testing.assert_allclose(
- G_sag, G_sinkhorn, atol=1e-03) # cf convergence sag
+ G_sag, G_sinkhorn, atol=1e-02) # cf convergence sag
np.testing.assert_allclose(
- G_asgd, G_sinkhorn, atol=1e-03) # cf convergence asgd
+ G_asgd, G_sinkhorn, atol=1e-02) # cf convergence asgd
#############################################################################
@@ -136,7 +136,7 @@ def test_stochastic_dual_sgd():
# test sgd
n = 10
reg = 1
- numItermax = 15000
+ numItermax = 5000
batch_size = 10
rng = np.random.RandomState(0)
@@ -167,7 +167,7 @@ def test_dual_sgd_sinkhorn():
# test all dual algorithms
n = 10
reg = 1
- nb_iter = 15000
+ nb_iter = 5000
batch_size = 10
rng = np.random.RandomState(0)
@@ -183,11 +183,11 @@ def test_dual_sgd_sinkhorn():
# check constratints
np.testing.assert_allclose(
- G_sgd.sum(1), G_sinkhorn.sum(1), atol=1e-03)
+ G_sgd.sum(1), G_sinkhorn.sum(1), atol=1e-02)
np.testing.assert_allclose(
- G_sgd.sum(0), G_sinkhorn.sum(0), atol=1e-03)
+ G_sgd.sum(0), G_sinkhorn.sum(0), atol=1e-02)
np.testing.assert_allclose(
- G_sgd, G_sinkhorn, atol=1e-03) # cf convergence sgd
+ G_sgd, G_sinkhorn, atol=1e-02) # cf convergence sgd
# Test gaussian
n = 30