问题
Looking at the comments for the code behind scipy.stats.wasserstein_distance
which invokes a function called _cdf_distance(p, u_values, v_values, u_weights=None, v_weights=None)
, it says this function implements the following formula:
l_p(u, v) = \left( \int_{-\infty}^{+\infty} |U-V|^p \right)^{1/p}
However, this is not the Wasserstein distance as I know it since, although I see the distance matrix |U-V|
in the above formula comment, the transport matrix is noticeably absent. The transport matrix is supposed to be multiplied against the distance matrix within the integral.
Why is the transport matrix missing from scipy.stats.wasserstein_distance
?
来源:https://stackoverflow.com/questions/65131513/transport-matrix-is-missing-in-the-code-behind-scipy-stats-wasserstein-distance