Skip to content
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

Missing rational function simplifications #606

Open
brandonwillard opened this issue Oct 2, 2021 · 0 comments · May be fixed by #634
Open

Missing rational function simplifications #606

brandonwillard opened this issue Oct 2, 2021 · 0 comments · May be fixed by #634
Labels
enhancement New feature or request graph rewriting help wanted Extra attention is needed important

Comments

@brandonwillard
Copy link
Member

brandonwillard commented Oct 2, 2021

We're missing some simplifications for rational functions. For example:

import aesara
import aesara.tensor as at


eta_at = at.scalar("eta")
kappa_at = at.scalar("kappa")

# This is equivalent to `1 / kappa_at`
graph_at = eta_at / kappa_at + (1 - eta_at) / kappa_at

graph_fn = aesara.function([eta_at, kappa_at], graph_at)

# The "optimized" graph still contains the unnecessary `eta` parameter:
aesara.dprint(graph_fn.maker.fgraph)
# Elemwise{Composite{((i0 / i1) + ((i2 - i0) / i1))}} [id A] ''   0
#  |eta [id B]
#  |kappa [id C]
#  |TensorConstant{1.0} [id D]
@brandonwillard brandonwillard added enhancement New feature or request help wanted Extra attention is needed important graph rewriting labels Oct 2, 2021
@brandonwillard brandonwillard changed the title Missing rational equation simplifications Missing rational function simplifications Oct 2, 2021
@kc611 kc611 linked a pull request Oct 28, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request graph rewriting help wanted Extra attention is needed important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant