Closed zsteve closed 3 years ago
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Totals | |
---|---|
Change from base Build 1164895949: | 0.0% |
Covered Lines: | 666 |
Relevant Lines: | 682 |
Merging #120 (f0addb0) into master (cfd4321) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #120 +/- ##
=======================================
Coverage 97.65% 97.65%
=======================================
Files 13 13
Lines 682 682
=======================================
Hits 666 666
Misses 16 16
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update cfd4321...f0addb0. Read the comment docs.
Merging since this only affects tests.
As mentioned in https://github.com/JuliaOptimalTransport/OptimalTransport.jl/pull/90#discussion_r644203936, this PR checks the gradients of
sinkhorn2
in its source and target measures (as obtained by ForwardDiff) against the analytic expression for the gradients.Reference: Proposition 2.3 of Cuturi, Marco, and Gabriel Peyré. "A smoothed dual approach for variational Wasserstein problems." SIAM Journal on Imaging Sciences 9.1 (2016): 320-343.
Note that for the result of Prop 2.3 to yield a valid gradient, one needs to run Sinkhorn up til convergence (potentially many iterations). The benefit of using Sinkhorn+AD is that AD can be used to yield a valid gradient (of the suboptimal Sinkhorn objective at a fixed iteration) for relatively small number of iterations. See e.g. https://arxiv.org/pdf/1708.01955.pdf.