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

Improve handling of unvalued/bound MeasurableVariables #209

Open
brandonwillard opened this issue Dec 4, 2022 · 0 comments
Open

Improve handling of unvalued/bound MeasurableVariables #209

brandonwillard opened this issue Dec 4, 2022 · 0 comments
Labels
enhancement New feature or request graph rewriting Involves the implementation of rewrites to Aesara graphs performance concern refactoring A change that improves the codebase but doesn't necessarily introduce a new feature request discussion

Comments

@brandonwillard
Copy link
Member

Our current approach of tracking Variables that have been converted to MeasurableVariables and reverting them when they're not eventually associated with a value variable (i.e. "bound" in some sense), is rather inefficient. We could—at the very least—make sure that these reversions are always performed in a reverse-topological order, so that fewer replacements are necessary (e.g. assuming that reversion is only ever necessary closest to the "base" valued/bound variable).

The reason we currently convert all terms to measurable terms—and not just the nodes that are directly bound/valued—is that some node conversions can only occur once the node's inputs are determined to be measurable. We can take a number of entirely different approaches, but the current is thorough and simple (e.g. MeasurableVariable-specific guided and short-circuited depth-first conversions, "inverse" functions associated with each MeasurableVariable type, consistent use of OpFromGraph, etc.) A fix to this issue could easily involve one of those approaches.

@brandonwillard brandonwillard added enhancement New feature or request graph rewriting Involves the implementation of rewrites to Aesara graphs request discussion refactoring A change that improves the codebase but doesn't necessarily introduce a new feature performance concern labels Dec 4, 2022
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 Involves the implementation of rewrites to Aesara graphs performance concern refactoring A change that improves the codebase but doesn't necessarily introduce a new feature request discussion
Projects
None yet
Development

No branches or pull requests

1 participant