-
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
Added output_length
and output_size
#270
Merged
Merged
Changes from 10 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6b46e34
added output_length and output_size to compute output, well, leengths
torfjelde 41d0b06
added tests for size of transformed dist using VcCorrBijector
torfjelde a76f18a
use already constructed transfrormation
torfjelde 6afc77e
TransformedDistribution should now also have correct variate form
torfjelde a4c5683
added proper variateform handling for VecCholeskyBijector too
torfjelde ea724ee
Apply suggestions from code review
torfjelde 387ef5a
added output_size impl for Reshape too
torfjelde acb5e8f
bump minor version
torfjelde 3391735
Apply suggestions from code review
torfjelde b524ebb
Update src/interface.jl
torfjelde d6dc906
Update src/bijectors/corr.jl
torfjelde 280708b
reverted removal of length as we'll need it now
torfjelde 2069d69
updated Stacked to be compat with changing sizes
torfjelde f533a79
forgot to commit deetion
torfjelde 56b8834
Apply suggestions from code review
torfjelde 098a9c0
add testing of sizes to `test_bijector`
torfjelde 4e14bb2
some more tests for stacked
torfjelde def7c6f
Update test/bijectors/stacked.jl
torfjelde fe36875
added awful generated function to determine output ranges for Stacked
torfjelde bbfaf19
added slightly more informative comment
torfjelde bf68124
format
torfjelde 45a9850
more fixes to that damned Stacked
torfjelde 1f0c374
Update test/interface.jl
torfjelde a917c2b
specialized constructors for Stacked further
torfjelde cdd951a
fixed bug in output_size for CorrVecBijector
torfjelde 5dbd829
Apply suggestions from code review
torfjelde 04f6990
Apply suggestions from code review
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,17 @@ function logabsdetjac(::Inverse{VecCorrBijector}, y::AbstractVector{<:Real}) | |
return _logabsdetjac_inv_corr(y) | ||
end | ||
|
||
function output_size(::VecCorrBijector, sz::Tuple{Int,Int}) | ||
@assert sz[1] == sz[2] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe make this a proper, more descriptive error?
torfjelde marked this conversation as resolved.
Show resolved
Hide resolved
|
||
n = sz[1] | ||
return (n * (n - 1)) ÷ 2 | ||
end | ||
|
||
function output_size(::Inverse{VecCorrBijector}, sz::Tuple{Int}) | ||
n = _triu1_dim_from_length(first(sz)) | ||
return (n, n) | ||
end | ||
|
||
""" | ||
VecCholeskyBijector <: Bijector | ||
|
||
|
@@ -317,6 +328,11 @@ function logabsdetjac(::Inverse{VecCholeskyBijector}, y::AbstractVector{<:Real}) | |
return _logabsdetjac_inv_chol(y) | ||
end | ||
|
||
output_size(::VecCholeskyBijector, sz::Tuple{Int,Int}) = output_size(VecCorrBijector(), sz) | ||
function output_size(::Inverse{<:VecCholeskyBijector}, sz::Tuple{Int}) | ||
return output_size(inverse(VecCorrBijector()), sz) | ||
end | ||
|
||
""" | ||
function _link_chol_lkj(w) | ||
|
||
|
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.
Just for the record: this isn't actually a breaking change, but I want to wait with a new release until we've merged this PR + #271 and #263 , i.e. we have have proper support for everything.
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.
With the changes to
Stacked
, this is now indeed a breaking PR.