-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numerical improvements to correlation bijectors #313
Merged
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bd6ff3d
Rename VecCholeskyBijector to VecCorrCholeskyBijector
sethaxen ee201de
Merge branch 'master' into patch
sethaxen 2d5ad82
Compute corr logdetjac during transform
sethaxen 9c3e22b
Enforce one-based indexing
sethaxen 5180c19
Add with_logabsdet_jacobian for correlation transforms
sethaxen 8186ee9
Add rrule for non-mutating ADs
sethaxen c0d8aa1
Update ChainRules to use manual rrule
sethaxen e47a946
Update Tracker to use manual rrule
sethaxen a3fe7bb
Remove rrule for ReverseDiff
sethaxen dd06582
Add module
sethaxen 9f34b9c
Make CorrBijector more numerically stable
sethaxen f417c32
Increment patch number
sethaxen 121e3cd
Revert "Rename VecCholeskyBijector to VecCorrCholeskyBijector"
sethaxen 010c695
Merge branch 'master' into patch
sethaxen c1dbb30
Update src/bijectors/corr.jl
torfjelde 289c689
Apply suggestions from code review
sethaxen f0ad121
Apply suggestions from code review
sethaxen a2eac95
Work around issues with Tracker
sethaxen 21189fa
import `stack` from Compat.jl (#314)
torfjelde f9a8687
import `stack` in tests too
torfjelde b6e7fa3
disable certain tests for ProductBijector on Julia versions with older
torfjelde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the problem is that neither
@grad
nor@grad_from_chainrules
supports multi-output functions (JuliaDiff/ReverseDiff.jl#221), so we cannot use this macro. At the same time, nothing in the function should not be AD-able by ReverseDiff, so I just removed the rule.However, we have the same problem with Tracker.
Tracker.@grad
seems to not support multi-output functions, and I'm still working out how to AD through the primal (I have an idea for a fix).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have an idea how to get this working for ReverseDiff, let me know. It would be great to use the manual pullback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, my Tracker idea did not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, it works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, how did you achieve it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this commit: a2eac95 . In Tracker, the cotangent of multi-output functions ends up being a
TrackedTuple
, which doesn't support iteration, so instead use indexing to split the tuple. And also makepd_from_lower
andpd_from_upper
use the same tricks ascholesky_upper
andcholesky_lower
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uuuuh I didn't know that that was the reason why it was an issue! Dopey:)