ott.solvers.linear.sinkhorn.Sinkhorn.output_from_state#
- Sinkhorn.output_from_state(ot_prob, state)[source]#
Create an output from a loop state.
Note
When differentiating the regularized OT cost, and assuming Sinkhorn has run to convergence, Danskin’s (or the envelope) theorem [Bertsekas, 1971, Danskin, 1967] states that the resulting OT cost as a function of the inputs (
geometry
,a
,b
) behaves locally as if the dual optimal potentials were frozen and did not vary with those inputs.Notice this is only valid, as when using
implicit_differentiation
mode, if the Sinkhorn algorithm outputs potentials that are near optimal. namely when the threshold value is set to a small tolerance.The flag
use_danskin
controls whether that assumption is made. By default, that flag is set to the value ofimplicit_differentiation
if not specified. If you wish to compute derivatives of order 2 and above, setuse_danskin
toFalse
.- Parameters:
ot_prob (
LinearProblem
) – the transport problem.state (
SinkhornState
) – a SinkhornState.
- Return type:
- Returns:
A SinkhornOutput.