Skip to content

Remove Iv core Op in favor of Ive and add rewrite rule for log of it#1929

Open
alessandrogentili001 wants to merge 3 commits intopymc-devs:v3from
alessandrogentili001:replace-Iv-op
Open

Remove Iv core Op in favor of Ive and add rewrite rule for log of it#1929
alessandrogentili001 wants to merge 3 commits intopymc-devs:v3from
alessandrogentili001:replace-Iv-op

Conversation

@alessandrogentili001
Copy link

Description

Related also to #1092.

  • Removed class Iv and its singleton from pytensor/scalar/math.py.
  • Replaced the iv @scalar_elemwise stub in pytensor/tensor/math.py with a plain symbolic function: ive(v, x) * exp(abs(x)) (matching kv/kve).
  • Updated I1.grad to use the new symbolic equivalent.
  • Added local_log_iv PatternNodeRewriter to pytensor/tensor/rewriting/math.py to directly rewrite log(iv(v, x)) into log(ive(v, x)) + abs(x).
  • Added test_log_iv_stabilization to verify that log(iv(4.5, 1000.0)) no longer overflows.
  • Removed jax_funcify_Iv from JAX dispatch, as the backend now traces through the symbolic graph smoothly

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@ricardoV94
Copy link
Member

Need to change xtensor to use a helper as well

@ricardoV94
Copy link
Member

You added a python exe binary, otherwise looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants