Lazy Symbolic Bayesian Inference: A Compiler for Junction Trees
Most exact-inference libraries treat junction-tree calibration as a
numerical procedure: build the tree, run two passes of message
passing, return the marginals. Change the evidence and the whole
pass runs again. PyBayes treats it as a compiler problem instead.
The junction tree is built once, then the calibration is reified as
a symbolic computation DAG of typed algebraic terms. A parallel
heap of torch.Tensor thunks hangs off that DAG, indexed by the
same identifiers, evaluated on demand and invalidated selectively
when evidence changes. The library is PyBayes
(github.com/dlewissandy/pybayes).