ott.geometry.costs.SqEuclidean

Contents

ott.geometry.costs.SqEuclidean#

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

Squared Euclidean distance.

Implemented as a translation invariant cost, \(h(z) = \|z\|^2\).

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 when using squared-Euclidean distance.

h(z)

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

h_legendre(z)

Legendre transform of h() when it is convex.

norm(x)

Compute squared Euclidean norm for vector.

pairwise(x, y)

Compute minus twice the dot-product between vectors.

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.