ott.geometry.costs.SqPNorm#
- class ott.geometry.costs.SqPNorm(p)[source]#
Squared p-norm of the difference of two vectors.
Uses custom implementation of norm to avoid NaN values when differentiating the norm of x-x.
- Parameters:
p (
float) – Power of the p-norm, \(\ge 1\).
Methods
all_pairs(x, y)Compute matrix of all pairwise costs, including the
norms.barycenter(weights, xs)Output barycenter of vectors.
h(z)TI function acting on difference of \(x-y\) to output cost.
h_legendre(z)Legendre transform of
h().h_transform(f[, solver])Compute the h-transform of a concave function.
Get an optimal transport map for a concave function \(g\).
twist_operator(vec, dual_vec, variable)Twist inverse operator of the cost function.