To exchange information over the tree factor graph, the FactorGraph provides forward–backward BP algorithm. We advise the reader to read the Section [forward–backward message passing schedule] (@ref treeSchedule) which provides a detailed description of the inference algorithm.
Each of the inference functions accepts only the composite type DiscreteTreeModel
, i.e., an output variable of the function bp = discreteTreeModel()
.
The set of functions that can be used to preform forward message inference:
forwardVariableFactor(bp)
forwardFactorVariable(bp)
The set of functions that can be used to preform backward message inference:
backwardVariableFactor(bp)
backwardFactorVariable(bp)
To compute normalized marginals the FactorGraph provides the function:
marginal(bp)
To compute unnormalized marginals the FactorGraph provides the function:
marginalUnnormalized(bp)
Same as before, functions accept the composite type DiscreteTreeModel
.