The ott.solvers module contains the main algorithmic engines of the OTT package. The biggest component in this module are without a doubt the linear solvers in ott.solvers.linear, designed to solve linear OT problems. More advanced solvers, notably quadratic in ott.solvers.quadratic, rely on calls to linear solvers as subroutines. That property itself is implemented in the more abstract WassersteinSolver class, which provides a lower-level template at the interface between the two.

Wasserstein Solver#

was_solver.WassersteinSolver([epsilon, ...])

A generic solver for problems that use a linear problem in inner loop.


utils.match_linear(x, y[, cost_fn, epsilon, ...])

Compute solution to a linear OT problem.

utils.match_quadratic(xx, yy[, x, y, ...])

Compute solution to a quadratic OT problem.

utils.sample_joint(rng, tmat)

Sample jointly from a transport matrix.

utils.sample_conditional(rng, tmat, *[, k])

Sample conditionally from a transport matrix.

utils.uniform_sampler(rng, num_samples[, ...])

Sample from a uniform distribution.