- aeppl.rewriting.construct_ir_fgraph(rv_values, ir_rewriter=None)#
FunctionGraphin measurable IR form for the keys in
A custom IR rewriter can be specified. By default,
Our measurable IR takes the form of an Aesara graph that is more-or-less equivalent to a given Aesara graph (i.e. the keys of
rv_values) but contains
Op`s that are subclasses of the `MeasurableVariabletype in place of ones that do not inherit from
MeasurableVariablein the original graph but are nevertheless measurable.
MeasurableVariables are mapped to log-probabilities, so this IR is how non-trivial log-probabilities are constructed, especially when the “measurability” of a term depends on the measurability of its inputs (e.g. a mixture).
In some cases, entire sub-graphs in the original graph are replaced with a single measurable node. In other cases, the relevant nodes are already measurable and there is no difference between the resulting measurable IR graph and the original. In general, some changes will be present, because–at the very least–canonicalization is always performed and the measurable IR includes manipulations that are not applicable to outside of the context of measurability/log-probabilities.
For instance, some
Op`s will be lifted through `MeasurableVariables in this IR, and the resulting graphs will not be computationally sound, because they wouldn’t produce independent samples when the original graph would. See https://github.com/aesara-devs/aeppl/pull/78.
- Return type
FunctionGraphof the measurable IR, a copy of
the new, cloned versions of the original variables in
dictmapping all the original variables to their cloned values in