-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed redundant imports to BijectorsZygoteExt * use cholesky_upper and cholesky_lower instead of cholesky_factor, etc. * added tests for CorrVecBijector * name testset correctly * use cholesky_lower and cholesky_upper instead of cholesky_factor * removed now-redundant cholesky_factor * Fix obsolete function references in tests. (#282) * Update chainrules.jl * Update corr.jl * Revert changes to transform. * removed type-piracy that has been addressed upstream and bumped Zygote version in test * use :L for Hermitian in `cholesky_lower` * fixed ForwardDiff tests for LKJCholesky * fixed tests for matrix dists and added tests for both values of uplo in LKJCholesky tests * another attempt at fixing Julia 1.6 tests --------- Co-authored-by: Hong Ge <3279477+yebai@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
81 additions
and
52 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@testset "AD for VecCorrBijector" begin | ||
d = 4 | ||
dist = LKJ(d, 2.0) | ||
b = bijector(dist) | ||
binv = inverse(b) | ||
|
||
x = rand(dist) | ||
y = b(x) | ||
|
||
test_ad(y) do x | ||
sum(transform(b, binv(x))) | ||
end | ||
|
||
test_ad(y) do y | ||
sum(transform(binv, y)) | ||
end | ||
end | ||
|
||
@testset "AD for VecCholeskyBijector" begin | ||
d = 4 | ||
dist = LKJCholesky(d, 2.0) | ||
b = bijector(dist) | ||
binv = inverse(b) | ||
|
||
x = rand(dist) | ||
y = b(x) | ||
|
||
test_ad(y) do y | ||
sum(transform(b, binv(y))) | ||
end | ||
|
||
test_ad(y) do y | ||
sum(Bijectors.cholesky_upper(transform(binv, y))) | ||
end | ||
end |
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