ott.geometry.costs.TICost#

class ott.geometry.costs.TICost[source]#

A class for translation invariant (TI) costs.

Such costs are defined using a function \(h\), mapping vectors to real-values, to be used as:

\[c(x,y) = h(z), z := x-y.\]

If that cost function is used to form an Entropic map using the [Brenier, 1991] theorem, then the user should ensure \(h\) is strictly convex, as well as provide the Legendre transform of \(h\), whose gradient is necessarily the inverse of the gradient of \(h\).

Methods

all_pairs(x, y)

Compute matrix of all costs (including norms) for vectors in x / y.

all_pairs_pairwise(x, y)

Compute matrix of all pairwise-costs (no norms) for vectors in x / y.

barycenter(weights, xs)

Barycentric operator.

h(z)

TI function acting on difference of \(x-y\) to output cost.

h_legendre(z)

Legendre transform of h() when it is convex.

pairwise(x, y)

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

Attributes

norm