ott.geometry.costs.Cosine
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 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.
pairwise
(x, y)Cosine distance between vectors, denominator regularized with ridge.
Attributes