ott.geometry.costs.PNormP

Contents

ott.geometry.costs.PNormP#

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

p-norm to the power p (and divided by p) 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 in \([1, +\infty)\). Note that h_legendre() is not defined for p = 1.

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)

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])

Compute the h-transform of a concave function.

pairwise(x, y)

Compute cost as evaluation of h() on \(x-y\).

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.

Attributes