We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01f8c44 commit ff104a6Copy full SHA for ff104a6
test/test_ot.py
@@ -3,7 +3,7 @@
3
import ot
4
import numpy as np
5
6
-#import pytest
+# import pytest
7
8
9
def test_doctest():
@@ -17,8 +17,28 @@ def test_doctest():
17
doctest.testmod(ot.bregman, verbose=True)
18
19
20
+def test_emd_emd2():
21
+ # test emd
22
+ n = 100
23
+
24
+ x = np.random.randn(n, 2)
25
+ u = ot.utils.unif(n)
26
27
+ M = ot.dist(x, x)
28
29
+ G = ot.emd(u, u, M)
30
31
+ # check G is identity
32
+ assert np.allclose(G, np.eye(n) / n)
33
34
+ w = ot.emd2(u, u, M)
35
36
+ # check loss=0
37
+ assert np.allclose(w, 0)
38
39
40
#@pytest.mark.skip(reason="Seems to be a conflict between pytest and multiprocessing")
-def test_emd_multi():
41
+def test_emd2_multi():
42
43
from ot.datasets import get_1D_gauss as gauss
44
0 commit comments