Improve handling of unvalued/bound MeasurableVariable
s
#209
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
Our current approach of tracking
Variable
s that have been converted toMeasurableVariable
s 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 eachMeasurableVariable
type, consistent use ofOpFromGraph
, etc.) A fix to this issue could easily involve one of those approaches.The text was updated successfully, but these errors were encountered: