ott.geometry.costs.TICost#
- class ott.geometry.costs.TICost[source]#
Base 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 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[, 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.