ott.geometry.costs.Arccos#
- class ott.geometry.costs.Arccos(n, ridge=1e-08)[source]#
Arc-cosine cost function [Cho and Saul, 2009].
The cost is implemented as:
\[c_n(x, y) = -\log(\frac{1}{\pi} \|x\|^n \|y\|^n J_n(\theta))\]where \(\theta := \arccos(\frac{x \cdot y}{\|x\| \|y\|})\) and \(J_n(\theta) := (-1)^n (\sin \theta)^{2n + 1} (\frac{1}{\sin \theta}\frac{\partial}{\partial \theta})^n (\frac{\pi - \theta}{\sin \theta})\).
- Parameters:
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)Compute cost between \(x\) and \(y\).
twist_operator
(vec, dual_vec, variable)Twist inverse operator of the cost function.
Attributes