-
Hi, thanks for providing such an amazing toolkit. Now I have two distributions
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hello, For exact OT the plan itself is not differentiable wrt the input but be have the gradient wrt the masses as a result of solving the problem (hence the need to use emd2 because the gradient is properly defined in the function). In emd the ot plan is detached from the input so if you recompute the loss it will be only wrt the distance matrix, not the masses. The unbalanced problems are smooth and we only use differentiable operation in the algorithm so you can use autodiff to compute the gradients wrt all the inputs. the plan is not detached for those functions so you can recompute the loss and the gradient will back-propagate. EDIT: more precisely unbalanced solvers are not differentiable yet I'm sorry but they will be very shortly because we have a PR #343 that will add it too the toolbox. |
Beta Was this translation helpful? Give feedback.
Hello,
For exact OT the plan itself is not differentiable wrt the input but be have the gradient wrt the masses as a result of solving the problem (hence the need to use emd2 because the gradient is properly defined in the function). In emd the ot plan is detached from the input so if you recompute the loss it will be only wrt the distance matrix, not the masses.
The unbalanced problems are smooth and we only use differentiable operation in the algorithm so you can use autodiff to compute the gradients wrt all the inputs. the plan is not detached for those functions so you can recompute the loss and the gradient will back-propagate.
EDIT: more precisely unbalanced solvers are not differen…