ott.solvers.linear.semidiscrete.HardAssignmentOutput

ott.solvers.linear.semidiscrete.HardAssignmentOutput#

class ott.solvers.linear.semidiscrete.HardAssignmentOutput(ot_prob, paired_indices, f=None, g=None)[source]#

Unregularized linear OT solution.

Parameters:
  • ot_prob (LinearProblem) – Linear OT problem.

  • paired_indices (Array) – Array of shape [2, n], of \(n\) pairs of indices, for which the optimal transport assigns mass. Namely, for each index \(0 \leq k < n\), if one has \(i := \text{paired_indices}[0, k]\) and \(j := \text{paired_indices}[1, k]\), then point \(i\) in the first geometry sends mass to point \(j\) in the second.

  • f (Optional[Array]) – The first dual potential.

  • g (Optional[Array]) – The second dual potential.

Methods

Attributes

dual_cost

Dual transport cost.

f

g

geom

Geometry.

matrix

Transport matrix of shape [n, m] with n non-zero entries.

primal_cost

Transport cost of the linear OT solution.

ot_prob

paired_indices