ott.geometry.costs.Cosine#

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

Cosine distance CostFn.

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)

rtype

float

padder(dim)

rtype

ndarray

pairwise(x, y)

Cosine distance between vectors, denominator regularized with ridge.

Attributes

norm

Parameters

ridge (float) –