-
Notifications
You must be signed in to change notification settings - Fork 132
Add Exponentially scaled modified Bessel Op #543
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 #543 +/- ##
=======================================
Coverage 80.90% 80.90%
=======================================
Files 162 162
Lines 46393 46415 +22
Branches 11349 11353 +4
=======================================
+ Hits 37535 37553 +18
- Misses 6635 6639 +4
Partials 2223 2223
|
Looks great, could also be a nice touch to add a rewrite to convert the iv/exp form into ive so users writing the old form get the more stable one now automatically |
Could use PatternRewriter like we did here: #505 |
Sounds good. The tricky thing is that we need an
but the use in PyMC is: a = 1 / pt.square(self.ls)
c = pt.where(J > 0, 2, 1)
q2 = c * pt.iv(J, a) / pt.exp(a) So unless we carry some "positive real" tag(s) around, we won't pickup this kind of case. Maybe not worth the complexity, and just add the above rewrite? Also, do you have a suggestion on how to handle the two forms? I.e. can I catch both these as one rewrite:
Is there a canonicalizing rewrite that will handle that? |
Canonicalize wouldn't do that kind of modification. You can write a more typical rewrite with a function that handles both cases. But since it needs to be positive maybe not worth adding for now. The kind of machinery in #525 would make it really easy to complement rewrites with positivity/negative analysis. This case may be a nice motivating example. |
So happy to go as is, or would you like me to add the rewrite with the |
Happy as is |
Fixes #542
As with
Iv
, uses scipy implementation in C code and tensorflow probability implementation for jax.Type of change