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\) beingjax.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.barycenter(weights, xs)Barycentric operator.
twist_operator(vec, dual_vec, variable)Twist inverse operator of the cost function.