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

Fix MH indexing bug #1135

Merged
merged 3 commits into from
Feb 29, 2020
Merged

Fix MH indexing bug #1135

merged 3 commits into from
Feb 29, 2020

Conversation

cpfiffer
Copy link
Member

This PR fixes #1133 by fixing a case where the Turing-side code was not passing scalars correctly to AdvancedMH.

Currently the way I handle passing NamedTuples into Turing is not very robust (and could be more performant), so I'm doubly open to comments on this one. set_namedtuple! for example is a very messy and ugly function that relies far too much on heuristics.

@devmotion
Copy link
Member

I'm not sure if this can be handled in a completely "nice" way at the moment. Maybe something along the lines of TuringLang/DynamicPPL.jl#5 would be helpful.

@cpfiffer
Copy link
Member Author

Looks like the test failures are due to nondeterminism in the VI suite. I'll open a separate PR to fix the test.

@cpfiffer
Copy link
Member Author

I think this can go through, at the very least to fix #1133. If the comments in TuringLang/DynamicPPL.jl#5 are addressed, I can come back to the general approach that AdvancedMH uses to integrate into Turing.

@yebai
Copy link
Member

yebai commented Feb 29, 2020

Maybe add a test for the error case?

@cpfiffer
Copy link
Member Author

Updated to include the test for the error.

@yebai yebai merged commit cd40e90 into master Feb 29, 2020
@delete-merged-branch delete-merged-branch bot deleted the csp/mh-fix branch February 29, 2020 17:57
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.

Failure working with MH sampler and MvNormal
3 participants