ott.solvers.linear.sinkhorn.Sinkhorn.output_from_state
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 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_differentiationmode, if the Sinkhorn algorithm outputs potentials that are near optimal. namely when the threshold value is set to a small tolerance.The flag
use_danskincontrols whether that assumption is made. By default, that flag is set to the value ofimplicit_differentiationif not specified. If you wish to compute derivatives of order 2 and above, setuse_danskintoFalse.- Parameters
ot_prob (
LinearProblem) – the transport problem.state (
SinkhornState) – a SinkhornState.
- Return type
- Returns
A SinkhornOutput.