-
Notifications
You must be signed in to change notification settings - Fork 536
-
Describe the bug
Hi there,
I have a project to compute different p-norm Wasserstein distances. I assume the function ot.dist(p = pnorm) is used to compute different p-norm cost matrices, which are referred to as "Minkowski distances" in the docstring. However, the following example shows that it does not follow what I expected.
import ot
import numpy as np
A = np.array([[0,0]])
B = np.array([[1,2]])
print(ot.dist(A,B,p = 1))
print(ot.dist(A,B,p = 2))
print(ot.dist(A,B,p = 3))
print(ot.dist(A,B,p = 4))
print(ot.dist(A,B,p = 5))
print(ot.dist(A,B,p = 6))
And the outputs are
[[5]]
[[5]]
[[5]]
[[5]]
[[5]]
[[5]]
Please let me know if there is any other function that can compute the p-norm function, as well as the 'inf'-norm case.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions
Hello,
As stated in the documentation and similarly to the original numpy functions parameter p is used only when the metric= 'minkowski' is passed since default is squared euclidean that corresponds to p=2
https://pythonot.github.io/all.html#ot.dist
Replies: 1 comment
-
Hello,
As stated in the documentation and similarly to the original numpy functions parameter p is used only when the metric= 'minkowski' is passed since default is squared euclidean that corresponds to p=2
https://pythonot.github.io/all.html#ot.dist
Beta Was this translation helpful? Give feedback.