Skip to content

p-norm vs Minkowski distance #671

@DRKWang

Description

@DRKWang

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions