ott.geometry.distrib_costs.UnivariateWasserstein

ott.geometry.distrib_costs.UnivariateWasserstein#

class ott.geometry.distrib_costs.UnivariateWasserstein(solve_fn, ground_cost=None)[source]#

1D Wasserstein cost for two 1D distributions.

This ground cost between considers vectors as a family of values. The Wasserstein distance between them is the 1D OT cost, using a user-defined ground cost.

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)

Wasserstein distance between \(x\) and \(y\) seen as a 1D dist.

twist_operator(vec, dual_vec, variable)

Twist inverse operator of the cost function.

Attributes