ott.problems.linear.potentials.DualPotentials.transport

ott.problems.linear.potentials.DualPotentials.transport#

DualPotentials.transport(vec, forward=True)[source]#

Transport vec according to Gangbo-McCann Brenier [Brenier, 1991].

Uses Proposition 1.15 from [Santambrogio, 2015] to compute an OT map when applying the inverse gradient of cost.

When the cost is a general cost, the operator uses the twist_operator() associated of the corresponding CostFn.

When the cost is a translation invariant TICost cost, \(c(x,y)=h(x-y)\), and the twist operator translates to the application of the convex conjugate of \(h\) to the gradient of the dual potentials, namely \(x- (\nabla h^*)\circ \nabla f(x)\) for the forward map, where \(h^*\) is the Legendre transform of \(h\). For instance, in the case \(h(\cdot) = \|\cdot\|^2, \nabla h(\cdot) = 2 \cdot\,\), one has \(h^*(\cdot) = \|.\|^2 / 4\), and therefore \(\nabla h^*(\cdot) = 0.5 \cdot\,\).

Note

When the dual potentials are solved in correlation form, and marked accordingly by setting corr to True, the maps are \(\nabla g\) for forward, \(\nabla f\) for backward map. This can only make sense when using the squared-Euclidean SqEuclidean cost.

Parameters:
  • vec (Array) – Points to transport, array of shape [n, d].

  • forward (bool) – Whether to transport the points from source to the target distribution or vice-versa.

Return type:

Array

Returns:

The transported points.