-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add LKJ bijector #125
Merged
devmotion
merged 64 commits into
TuringLang:master
from
yiyuezhuo:Stan_corr_impl_adjoint
Aug 24, 2020
Merged
Add LKJ bijector #125
Changes from 3 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
a8c32a2
add a stan style corr bijector
yiyuezhuo ba1ab40
implement a version which is only compatible with ForwardDiff AD backend
yiyuezhuo a98ce04
add AD support except Tracker
yiyuezhuo 74c902b
sync
yiyuezhuo 9c1742c
add tests for interface
yiyuezhuo a1f8ec7
Update src/bijectors/corr.jl
yiyuezhuo 1c9b4ea
Update src/bijectors/corr.jl
yiyuezhuo a52bdce
Update src/bijectors/corr.jl
yiyuezhuo ead7e71
Update src/bijectors/corr.jl
yiyuezhuo 32cab00
Update src/bijectors/corr.jl
yiyuezhuo 1859672
Update src/bijectors/corr.jl
yiyuezhuo 1ef50b0
Update src/bijectors/corr.jl
yiyuezhuo 5ecaaee
Update src/compat/tracker.jl
yiyuezhuo bf41efc
Update src/bijectors/corr.jl
yiyuezhuo 52e74e4
Update src/bijectors/corr.jl
yiyuezhuo be3dddf
Update src/compat/zygote.jl
yiyuezhuo 476ca0f
Update src/bijectors/corr.jl
yiyuezhuo bfd8d4f
Update src/bijectors/corr.jl
yiyuezhuo dd0fade
Update src/compat/zygote.jl
yiyuezhuo 38785f5
Update src/compat/reversediff.jl
yiyuezhuo 463acdc
Update src/compat/reversediff.jl
yiyuezhuo 5bdea37
Update src/compat/tracker.jl
yiyuezhuo 131c502
Update src/bijectors/corr.jl
yiyuezhuo 4bbe656
stash
yiyuezhuo 8d2fc60
pass basic tests for all AD
yiyuezhuo 1120763
clean up
yiyuezhuo eec4de0
add data only AD unit test
yiyuezhuo d9e0abf
fix type instability
yiyuezhuo 1f24e65
Update src/bijectors/corr.jl
yiyuezhuo 09297e9
Update src/bijectors/corr.jl
yiyuezhuo 388fee0
Update src/compat/reversediff.jl
yiyuezhuo 72a16a8
Update src/compat/tracker.jl
yiyuezhuo d2908d5
Update src/bijectors/corr.jl
yiyuezhuo 8eb0686
Update src/bijectors/corr.jl
yiyuezhuo 9260c61
remove link_lkj and inv_link_lkj
yiyuezhuo 02a7d7e
switch looping order
yiyuezhuo d0984a4
rename logabsdetjac_lkj_inv and merge z
yiyuezhuo 10c2aed
fix zeros type instability
yiyuezhuo fc6af4f
add @inbounds
yiyuezhuo 5ee5826
replace log(1 - tanh(y[...])^2) with numerically stable implementation
yiyuezhuo 917605f
removed logabsdetjac_lkj_inv
yiyuezhuo 32497a1
rename two functions used in corr
yiyuezhuo c82e57c
Merge branch 'master' into Stan_corr_impl_adjoint
yiyuezhuo c13d8a2
Update src/bijectors/corr.jl
yiyuezhuo 01250ce
Update src/bijectors/corr.jl
yiyuezhuo de86456
Apply suggestions from code review
yiyuezhuo 5238efe
Update src/bijectors/corr.jl
yiyuezhuo 3a01d90
add broken test
yiyuezhuo c86bcdf
Merge branch 'Stan_corr_impl_adjoint' of https://github.com/yiyuezhuo…
yiyuezhuo 79cbc5e
apply some suggestions
yiyuezhuo 01db0f4
avoid some zero filling
yiyuezhuo 8cfc22d
move dense transform as last as possible, add reversediff dense dense…
yiyuezhuo 9c9846b
furthur remove extra zero filling and f(0) leveraging UpperTriangular…
yiyuezhuo 9746499
forward special speedup, drop copy-paste maintain ability
yiyuezhuo 7fb2675
Apply suggestions from code review
yiyuezhuo bad759b
optimize forwarddiff and remove custom AD for reversediff
yiyuezhuo 7710187
Merge branch 'Stan_corr_impl_adjoint' of https://github.com/yiyuezhuo…
yiyuezhuo 5228310
fix suggestion mistake and clean up
yiyuezhuo ea71cd7
small optimizing and clean up
yiyuezhuo a577b05
add re-derived analytic gradient
yiyuezhuo 50b837d
simplify code (though make code hard to read)
yiyuezhuo b04252b
add @bounds
yiyuezhuo 6c525a7
Merge branch 'master' into Stan_corr_impl_adjoint
yiyuezhuo 7e46a09
bump version number to 0.8.3 and modify test and improve document
yiyuezhuo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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.
Bijectors.jl/test/transform.jl
Line 66 in b0aaa98
+ zero(x)
?This hack is really really ugly and unintuitive - e.g., if we would an
Array
in the end (I'm questioning that) it would be much more natural to call justArray(r)
instead of some weird addition.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.
correlation matrix: Test Failed at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:67
Expression: typeof(x) == typeof(y)
Evaluated: Array{Float64,2} == UpperTriangular{Float64,Array{Float64,2}}
Stacktrace:
[1] single_sample_tests(::LKJ{Float64,Int64}) at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:67
[2] top-level scope at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:203
[3] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
[4] top-level scope at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:201
correlation matrix: Test Failed at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:82
Expression: typeof(xs) == typeof(ys)
Evaluated: Array{Array{Float64,2},1} == Array{UpperTriangular{Float64,Array{Float64,2}},1}
Stacktrace:
[1] multi_sample_tests(::LKJ{Float64,Int64}, ::Array{Float64,2}, ::Array{Array{Float64,2},1}, ::Int64) at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:82
[2] top-level scope at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:220
[3] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
[4] top-level scope at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:201
Test Summary: | Pass Fail Total
correlation matrix | 9 2 11
ERROR: LoadError: LoadError: Some tests did not pass: 9 passed, 2 failed, 0 errored, 0 broken.
in expression starting at /home/yiyuezhuo/.julia/dev/Bijectors/test/transform.jl:199
in expression starting at /home/yiyuezhuo/.julia/dev/Bijectors/test/runtests.jl:22
ERROR: Package Bijectors errored during testing
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.
I don't know why this test exists at all. My suggestion would be to just remove (or comment out) the test. But I guess @torfjelde might know why the test exists?