ott.geometry.costs.SqEuclidean#
- class ott.geometry.costs.SqEuclidean[source]#
Squared Euclidean distance.
Implemented as a translation invariant cost, \(h(z) = \|z\|^2\).
Methods
all_pairs(x, y)Compute matrix of all pairwise costs, including the
norms.barycenter(weights, xs)Output barycenter of vectors when using squared-Euclidean distance.
h(z)TI function acting on difference of \(x-y\) to output cost.
h_legendre(z)Legendre transform of
h()when it is convex.h_transform(f[, solver])Compute the h-transform of a concave function.
norm(x)Compute squared Euclidean norm for vector.
Get an optimal transport map for a concave function \(g\).
twist_operator(vec, dual_vec, variable)Twist inverse operator of the cost function.