-
-
Notifications
You must be signed in to change notification settings - Fork 20
Improve handling of unvalued/bound MeasurableVariables #209
Description
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.