-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 SymbolicDistribution and Censored distributions #5169
Conversation
7639c7f
to
729c221
Compare
Codecov Report
@@ Coverage Diff @@
## main #5169 +/- ##
==========================================
+ Coverage 79.08% 79.09% +0.01%
==========================================
Files 87 88 +1
Lines 14394 14516 +122
==========================================
+ Hits 11383 11482 +99
- Misses 3011 3034 +23
|
ec92fed
to
ed7e2b0
Compare
a0ccd82
to
34e2fab
Compare
@ricardoV94 This is becoming a blocker for time series, how much is left to do here? |
I am getting back to this one this week! |
In the meantime, suggestions for the base class name?
|
|
What purpose are these |
They serve the same goal the "standard" Distribution class is doing right now: basically manage all non distribution kwargs: shape/dims, transformed, observed; and behind the scenes magic things like value variables and rngs |
The base By extending This isn't the time or place to start addressing all that, but these are the kinds of design considerations that need to go alongside changes/additions to the relevant areas of code (i.e. |
2329885
to
785ee15
Compare
785ee15
to
81b3dc4
Compare
d9e7db0
to
3fae5c9
Compare
728d816
to
766ac8d
Compare
* Fix invalid code example in docstrings * Rename distribution parameter to dist * Use `check_dist_not_registered` helper
766ac8d
to
4fc7dc9
Compare
@brandonwillard do you have other pointers for this PR? It is currently blocked by your old requested changes concerning docstrings |
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.
@brandonwillard do you have other pointers for this PR? It is currently blocked by your old requested changes concerning docstrings
Sorry, I dismissed the old review; otherwise, I don't have any more input for this PR right now.
Thanks @ricardoV94! Can't wait to try these out. |
@@ -354,11 +355,268 @@ def dist( | |||
return rv_out | |||
|
|||
|
|||
class SymbolicDistribution: |
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.
Will those show up in the docs?
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.
We also didn't mention it in the release notes.
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.
They show in the docs (you can check the RTD job in this PR). I didn't see the SymbolicDist as being user facing, that's why it's not mentioned in the release notes.
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.
I agree, but it's such an important new addition that I think it deserves some more attention.
With aesara-devs/aeppl#22 we can now compute the logprob of censored Distributions.
This PR adds those to PyMC:
A large chunk of this PR concerns how to accommodate aeppl derived distributions with PyMC API seamlessly. To do this I started by duplicating
pymc.Distribution
intopymc.DerivedDistribution
and changing things as necessary. Hopefully we will be able to use the same class in the end or at least refactor large chunks that are shared...This may not be the best way... Suggestions are welcome
What works:
TODO:
shape_utils.maybe_resize