ott.geometry.costs.EuclideanP

Contents

ott.geometry.costs.EuclideanP#

class ott.geometry.costs.EuclideanP(p)[source]#

\(p\)-power of Euclidean norm.

Uses custom implementation of norm to avoid NaN values when differentiating the norm of \(x-x\).

Parameters:

p (float) – Power used to raise Euclidean norm, in \([1, +\infty)\).

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() when it is convex.

h_transform(f[, ridge, solver])

Compute the h-transform of a concave function.

transport_map(g)

Get an optimal transport map for a concave function \(g\).

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.