Skip to content
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

Merged
merged 3 commits into from
Apr 15, 2024
Merged

Conversation

torfjelde
Copy link
Member

@torfjelde
Copy link
Member Author

@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.
Copy link
Member

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).

Copy link
Member

@devmotion devmotion left a 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.

@torfjelde
Copy link
Member Author

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) 👍

@torfjelde torfjelde merged commit e522155 into master Apr 15, 2024
23 checks passed
@delete-merged-branch delete-merged-branch bot deleted the torfjelde/simplex-batch-fix branch April 15, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants