-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support logp derivation of power(base, rv)
#6962
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6962 +/- ##
==========================================
- Coverage 92.18% 92.11% -0.08%
==========================================
Files 100 100
Lines 16847 16896 +49
==========================================
+ Hits 15531 15563 +32
- Misses 1316 1333 +17
|
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.
This looks amazing!!!
Just some small suggestions for comments / tests, but nothing about the fundamentals
power(base, rv)
Co-authored-by: Ricardo Vieira <[email protected]>
Co-authored-by: Ricardo Vieira <[email protected]>
Co-authored-by: Ricardo Vieira <[email protected]>
Co-authored-by: Ricardo Vieira <[email protected]>
Co-authored-by: Ricardo Vieira <[email protected]>
Thanks @LukeLB, sounds line we nailed all these Elemwise transforms? |
Cheers! Yep all done💥 |
Addresses the first case in #6896, allowing users to evaluate the log prob of generalised bases e.g, power(base, x). This constricts base to be either a constant or a continuous random variable as long as its vaue is greater or equal to 0.
I've added a node rewrite function to deal with the power(base, x) case. To make sure that power(x, exponent) is unaffected by this rewrite I have made changes to
find_measurable_transform
. This is based upon the ordering of the node inputs which is assumed to always be node.inputs = [base, exponent], where the new rewrite takes the case where index 1 is measurable and PowerTransform takes the case where index 0 is measurable.Closes #6896
...
Checklist
New features
📚 Documentation preview 📚: https://pymc--6962.org.readthedocs.build/en/6962/