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.
Attributes