Open adam-ah opened 6 years ago
@madras380 FYI
I'm not sure of the cause, but my guess is that it has to do with the iterative min-cost flow algorithm in the underlying C++ library. Unfortunately I don't have time to look into this right now.
@adam-ah The value is slightly different is because the definition of emd given in Fast and Robust Earth Mover’s Distances is different from the standard emd distance.
When calculating the optimal flow the algorithm is correct but seems like the EMD is a little off from what I would correctly get with flow_matrix * distance_matrix
Distance matrix:
arr1:
arr2:
The final value should be
but instead it is 1.57896825463524 (err=0.002170575465)
Types (distance, arr1, arr2): {dtype} float64 System: Mac OS X, 10.13.4 PIP pyemd: 0.5.1
Seems like too big of an error to be explained by floating point precision. Also, for floating point precision error the calculated flow should be off as well, but that seems to be accurate.