-
Couldn't load subscription status.
- Fork 536
Can POT be used to compute Wasserstein-2 distance between 2D distributions? #479
-
It seems to me that, at the moment, POT doesn't have an API to compute the Wasserstein-2 distance, but I would like to have a confirmation from you because I could be wrong.
Specifically, I need to compute the Wasserstein-2 distance between a Gaussian distribution and a set of data.
Obviously if the answer is :"yes, you can compute it", please tell me also how ^^.
Beta Was this translation helpful? Give feedback.
All reactions
Hi,
yes you can compute it. for 2D data, if you have samples then you can use the code in this examples
https://github.com/PythonOT/POT/blob/master/examples/plot_OT_2D_samples.py
and it also works for higher dimensional data as long as you have samples.
Replies: 1 comment 1 reply
-
Hi,
yes you can compute it. for 2D data, if you have samples then you can use the code in this examples
https://github.com/PythonOT/POT/blob/master/examples/plot_OT_2D_samples.py
and it also works for higher dimensional data as long as you have samples.
Beta Was this translation helpful? Give feedback.
All reactions
-
Ah, ok, thank you! I saw the emd2 function but I was deceived by the name "emd" which stands (I think) for "earth mover's distance" and on wikipedia I read that the earth mover's distance is the Wasserstein-1, so I skipped that. Also I didn't think about the fact that the emd2 function accepts a matrix M of costs and that differents costs would lead to differents distances.
Anyway, thank you!
Beta Was this translation helpful? Give feedback.