Adding notebook demoing using Mici with PyMC3 model #4
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.
This is intended to address #3. It adds a tutorial notebook explaining how to sample from the posterior defined using a PyMC3 model using Mici. A hierarchical linear regression model from this PyMC3 tutorial is used as an example model. Most of the code is not model specific and so could be used with other PyMC3 models and convenience function partially replicating the signature of the PyMC3
sample
function is provided to act as a (sort of) drop-in replacement for sampling with Mici instead of the inbuilt sampler implementations.@twiecki - if you have a chance could you possibly have a look through the notebook to see if you have any suggestions for clarifications or improvements to how I am handling getting the log density and gradient functions from the PyMC3 model? One thing in particular I wasn't sure about is if my description of why the
set_extra_values({})
call to theValueGradFunction
instance is necessary before calling the object is correct.