ott.problems.quadratic.quadratic_problem.QuadraticProblem.marginal_dependent_cost#
- QuadraticProblem.marginal_dependent_cost(marginal_1, marginal_2, *, remove_scale=False)[source]#
Initialize cost term that depends on the marginals of the transport.
Uses the first term in eq. 6, p. 1 of [Peyré et al., 2016].
Let \(p\) be the [n,] marginal of the transport matrix for samples from
geom_xx
and \(q\) the [m,] marginal of the transport matrix for samples fromgeom_yy
.When
cost_xx
(resp.cost_yy
) is the cost matrix ofgeom_xx
(resp.geom_yy
), the cost term that depends on these marginals can be written as:\[\text{marginal_dep_term} = \text{lin1}(\text{cost_xx}) p \mathbb{1}_{m}^T + \mathbb{1}_{n}(\text{lin2}(\text{cost_yy}) q)^T\]This helper function instantiates these two low-rank matrices and groups them into a single low-rank cost geometry object.
- Parameters:
- Return type:
- Returns:
Low-rank geometry of rank 2, storing normalization constants.