ott.solvers.linear.univariate.UnivariateOutput

Contents

ott.solvers.linear.univariate.UnivariateOutput#

class ott.solvers.linear.univariate.UnivariateOutput(prob, ot_costs, paired_indices=None, mass_paired_indices=None, dual_a=None, dual_b=None)[source]#

Output of the univariate solver.

Parameters:
  • prob (LinearProblem) – Linear problem between two weighted [n, d] and [m, d] point clouds.

  • ot_costs (Array) – Array of shape [d,] of OT costs, computed independently along each of the \(d\) slices.

  • paired_indices (Optional[Array]) – Array of shape [d, 2, n + m], of \(n + m\) pairs of indices, for which the optimal transport assigns mass, on each slice of the \(d\) slices described in the dataset. Namely, for each index \(0 <= k < n + m\), \(0 <= s < d\), if one has \(i := \text{paired_indices}[s, 0, k]\) and \(j := \text{paired_indices}[s, 1, k]\), then point \(i\) in the first point cloud sends mass to point \(j\) in the second, in slice \(s\).

  • mass_paired_indices (Optional[Array]) – [d, n + m] array of weights. Using the notation above, if \(0 <= k < n + m\), and \(0 <= s < d\) then writing \(i := \text{paired_indices}[s, 0, k]\) and \(j := \text{paired_indices}[s, 1, k]\), point \(i\) sends \(\text{mass_paired_indices}[s, k]\) to point \(j\).

  • dual_a (Optional[Array]) – Array of shape [n,] containing the first dual variable.

  • dual_b (Optional[Array]) – Array of shape [m,] containing the second dual variable.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

Attributes

dual_a

Alias for field number 4

dual_b

Alias for field number 5

dual_costs

Array of shape [d,] containing the dual costs.

mass_paired_indices

Alias for field number 3

mean_transport_matrix

Mean transport matrix, averaged over \(d\) slices.

ot_costs

Alias for field number 1

paired_indices

Alias for field number 2

prob

Alias for field number 0

transport_matrices

Array of shape [d, n, m] containing all transport matrices.