-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add the NUTS sampler constructor #35
Conversation
724c384
to
499df75
Compare
e335301
to
0a2b99b
Compare
My original plan of treating the general case (only some variables sampled using NUTS) was too general so I am working on a simpler version which should be mergeable sooner. |
Codecov Report
@@ Coverage Diff @@
## main #35 +/- ##
===========================================
- Coverage 100.00% 99.72% -0.28%
===========================================
Files 4 6 +2
Lines 295 358 +63
Branches 20 31 +11
===========================================
+ Hits 295 357 +62
- Partials 0 1 +1
Continue to review full report at Codecov.
|
24806bd
to
a6c80c5
Compare
I finished a first (working) draft of the NUTS sampler constructor. The test passes locally, but we need a new release of I left the warmup out; how we integrate it should be part of a broader reflection on the output of Since this is meant to be a black box it would be nice to output some information about the kernel that was built (transforms, for instance) in a way that is useful to users. We need to set conventions for the output of kernels. We currently have the kernel's state, the values of the parameters in the transformed and untransformed space, and updates. The Gibbs samplers' output is different. Again, I will open an issue to discuss this further. I currently pull the default transforms from |
To be able to add the warmup we will need to address the following issue in Aehmc: aesara-devs/aehmc#65. |
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.
Needs some minor docstring changes; otherwise, looks good.
I wanted to simplify the tests, and found a subtle bug: unobserved_rvs = set(model.rvs_to_values.keys()) - set(model.observed_rvs) doesn't preserve the ordering in |
db82b72
to
95f685e
Compare
Corrected the bug, simplified the test (untransformed and transformed variables in the same model), good to merge if the tests pass (Codecov complains about a part of |
I don't see the apparent coverage patch (or project) issue reported by Codecov, so we can ignore those failures. |
9794b3a
to
5806c67
Compare
I added an explicit return type as requested and updated the code / dependencies to include the latest changes in AeHMC. |
In this PR we add a function that uses the NUTS kernel implemented in
aehmc
to build a function that samples from the posterior distribution of a model specified in aModelInfo
instance. It is a first step towards the general-purpose sampler mentioned in #26.