Thanks @smth  - seems like there’s quite a few ways of doing the same thing?

Exact calculation using the pyemd 22 module - which is really slow because it does a linear program
i ) If I understand correctly, the wasserstein.jl layer in Mocha uses Sinkhorn’s algorithm to approximate the Wasserstein distance
ii) The code in the repo above which uses something similar to sgd,
iii) Your code which I need to have a good look at.

They should all roughly give the same value!
It should be pretty simple to do the test between the different methods - here’s the example code from case 0)
>>> from pyemd import emd
>>> import numpy as np
>>> first_signature = np.array([0.0, 1.0])
>>> second_signature = np.array([5.0, 3.0])
>>> distance_matrix = np.array([[0.0, 0.5], [0.5, 0.0]])
>>> emd(first_signature, second_signature, distance_matrix)
3.5