[MRG] Fix ordering by AdrienCorenflos · Pull Request #139 · PythonOT/POT

Errr, sorry about that. Tbh I ran the asserts in the first comment but not the test in the PR :)

On Thu, 2 Apr 2020, 07:56 Romain Tavenard, ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In test/test_ot.py <#139 (comment)>: > + + M = ot.dist(u, v, metric='sqeuclidean') + + G, log = ot.emd(w_u, w_v, M, log=True) + wass = log["cost"] + G_1d, log = ot.emd_1d(u, v, w_u, w_v, metric='sqeuclidean', log=True) + wass1d = log["cost"] + wass1d_emd2 = ot.emd2_1d(u, v, w_u, w_v, metric='sqeuclidean', log=False) + wass1d_euc = ot.emd2_1d(u, v, w_u, w_v, metric='euclidean', log=False) + + # check loss is similar + np.testing.assert_allclose(wass, wass1d) + np.testing.assert_allclose(wass, wass1d_emd2) + + # check loss is similar to scipy's implementation for Euclidean metric + wass_sp = wasserstein_distance(u.reshape((-1,)), v.reshape((-1,))) You forgot the weights here, which is probably why the test fails at the moment — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#139 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEYGFZ43WKD5O4NXGICOKNLRKQZKLANCNFSM4LYZNRDA> .