Open
Description
Description
PyTensor is missing this simple rewrite:
import pytensor.tensor as pt
from pytensor.graph import rewrite_graph
x = pt.scalar("x")
out = pt.softplus(pt.log(x))
new_out = rewrite_graph(out, include=("canonicalize", "stabilize", "specialize"))
new_out.dprint()
I am ready to propose a PR that addresses this issue.
I could also extend it to cover the case softplus(-log(x)) -> log1p(1/x)
. However I have noticed that even the simple exp(-log(x)) -> 1/x
is missing, so I wonder if there is an underlying reason to avoid such simplifications, that I am not aware of.
Metadata
Metadata
Assignees
Labels
No labels