-
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
Bugfix for SimplexBijector
on Matrix
#302
Conversation
@yebai @devmotion should be a quick merge |
@@ -136,6 +136,12 @@ function logabsdetjac(b::SimplexBijector, x::AbstractVector{T}) where {T} | |||
|
|||
return -lp | |||
end | |||
|
|||
# Needed to avoid falling back to `with_logabsdet_jacobian` for matrix inputs. |
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.
Which calls logabsdetjac
again causing a stackoverflow error (had to check the code to realize this is the underlying problem).
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.
Looks good to me (the problem was not clear to me initially but I think I understood now).
The PR made me wonder whether it would be possible to improve performance of with_logabsdet_jacobian
for SimplexBijector
by not performing transform
and logabsdetjac
separately when both are requested. Doesn't block this PR and maybe would lead to more code duplications though.
Definitively! But yeah, probs for another PR (I'll make issue) 👍 |
Related: TuringLang/Turing.jl#2190