ott.geometry.costs.Euclidean

Contents

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 pairwise costs, including the norms.

all_pairs_pairwise(x, y)

Compute matrix of all pairwise costs, excluding the norms.

barycenter(weights, xs)

Barycentric operator.

pairwise(x, y)

Compute Euclidean norm using custom jvp implementation.

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.

Attributes

norm