Skip to content

Commit 1ceb1a9

Browse files
author
Kilian Fatras
committed
fix metric test
1 parent 24b268c commit 1ceb1a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/test_bregman.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ def test_empirical_sinkhorn():
199199
X_s = np.reshape(np.arange(n), (n, 1))
200200
X_t = np.reshape(np.arange(0, n), (n, 1))
201201
M = ot.dist(X_s, X_t)
202-
M_e = ot.dist(X_s, X_t, metric='euclidean')
202+
M_m = ot.dist(X_s, X_t, metric='minkowski')
203203

204204
G_sqe = ot.bregman.empirical_sinkhorn(X_s, X_t, 1)
205205
sinkhorn_sqe = ot.sinkhorn(a, b, M, 1)
206206

207-
G_e = ot.bregman.empirical_sinkhorn(X_s, X_t, 1)
208-
sinkhorn_e = ot.sinkhorn(a, b, M_e, 1)
207+
G_m = ot.bregman.empirical_sinkhorn(X_s, X_t, 1, metric='minkowski')
208+
sinkhorn_m = ot.sinkhorn(a, b, M_m, 1)
209209

210210
loss_emp_sinkhorn = ot.bregman.empirical_sinkhorn2(X_s, X_t, 1)
211211
loss_sinkhorn = ot.sinkhorn2(a, b, M, 1)
@@ -216,9 +216,9 @@ def test_empirical_sinkhorn():
216216
np.testing.assert_allclose(
217217
sinkhorn_sqe.sum(0), G_sqe.sum(0), atol=1e-05) # metric sqeuclidian
218218
np.testing.assert_allclose(
219-
sinkhorn_e.sum(1), G_e.sum(1), atol=1e-05) # metric euclidian
219+
sinkhorn_m.sum(1), G_m.sum(1), atol=1e-05) # metric euclidian
220220
np.testing.assert_allclose(
221-
sinkhorn_e.sum(0), G_e.sum(0), atol=1e-05) # metric euclidian
221+
sinkhorn_m.sum(0), G_m.sum(0), atol=1e-05) # metric euclidian
222222
np.testing.assert_allclose(loss_emp_sinkhorn, loss_sinkhorn, atol=1e-05)
223223

224224

0 commit comments

Comments
 (0)