Closed zsteve closed 2 years ago
Another problem of the proposed fix is that it won't allow us anymore to fuse the broadcast operations: we should have use dot_matwise(...) .+ eps .* reshape(...) on the master branch, it seems currently an intermediate array is created if reshape(...) returns an array. Maybe this fixes already the ReverseDiff issue?
Thanks for the insight - just checked this and indeed you're right :D It fixes the issue much more painlessly. Will revert to that and keep the tests.
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 1186185679: | 0.9% |
Covered Lines: | 662 |
Relevant Lines: | 671 |
Merging #130 (23a796a) into master (ab9bc76) will increase coverage by
0.88%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 97.77% 98.65% +0.88%
==========================================
Files 14 14
Lines 673 671 -2
==========================================
+ Hits 658 662 +4
+ Misses 15 9 -6
Impacted Files | Coverage Δ | |
---|---|---|
src/entropic/sinkhorn.jl | 100.00% <ø> (ø) |
|
src/exact.jl | 98.13% <0.00%> (+5.47%) |
:arrow_up: |
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 ab9bc76...23a796a. Read the comment docs.
Using
ReverseDiff
with the current implementation ofsinkhorn2
breaks:yields an error
The error is due to the second line of the below, which handles both cases where the output is scalar or array. This seems to cause issues with ReverseDiff.
This PR instead uses a multiple dispatch on the type of
γ
, and so mitigates the error. I've updated the tests to check gradient computations using both ForwardDiff and ReverseDiff.