ott.geometry.costs.Euclidean#

class ott.geometry.costs.Euclidean[source]#

Euclidean distance.

Note that the Euclidean distance is not cast as a TICost, since this would correspond to \(h\) being jax.numpy.linalg.norm(), whose gradient is not invertible, because the function is not strictly convex (it is linear on rays).

Methods

all_pairs(x, y)

Compute matrix of all costs (including norms) for vectors in x / y.

all_pairs_pairwise(x, y)

Compute matrix of all pairwise-costs (no norms) for vectors in x / y.

barycenter(weights, xs)

Barycentric operator.

pairwise(x, y)

Compute Euclidean norm.

Attributes

norm