ott.geometry.costs.Cosine

Contents

ott.geometry.costs.Cosine#

class ott.geometry.costs.Cosine(ridge=1e-08)[source]#

Cosine distance cost function.

Parameters:

ridge (float) – Ridge regularization.

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)

Barycentric operator.

pairwise(x, y)

Cosine distance between vectors, denominator regularized with ridge.

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.

Attributes

norm