-
Notifications
You must be signed in to change notification settings - Fork 130
Rewrite useless log1mexp(log1mexp(x))
#474
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #474 +/- ##
==========================================
- Coverage 80.66% 80.65% -0.01%
==========================================
Files 160 160
Lines 46025 46030 +5
Branches 11266 11267 +1
==========================================
Hits 37124 37124
- Misses 6668 6672 +4
- Partials 2233 2234 +1
|
# Case for log1mexp(log1mexp(x)) -> x | ||
if isinstance(prev_op, aes_math.Log1mexp) and isinstance(node_op, aes_math.Log1mexp): | ||
if isinstance(prev_op, aes_math.Log1mexp) and isinstance( |
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 makes more sense as a separate rewrite, analogous to the local_func_inv
, something like local_func_inv_nan_switch
. Otherwise looks nice. Would also need a test
log1mexp(log1mexp(x))
Signed-off-by: Nathaniel <[email protected]>
Not entirely sure why this would fail @ricardoV94 , i haven't touched any code on the failing test: |
Closes #471
Small rewrite changes to allow pytensor to cancel iterative applications of the log1mexp() function
The lack of rewrite caused issues in the application of pm.Censored on the Weibull distribution: pymc-devs/pymc-examples#580
...
I've added a new case to the existing math re-write functions as discussed with @ricardoV94
...
Checklist
Major / Breaking Changes
NA
New features
NA
Bugfixes
NA
Documentation
NA
Maintenance
NA