The ecosystem
The engine defines no node and no rule. The nodes, their rules and the numerics they need are in packages of their own. Each rule package depends on MessagePassingRulesBase and never on the engine. The engine finds rules through the base package's method table, which is global across every loaded package, so loading a package is enough for the engine to find its rules. Every package has its own documentation site, linked from its name below.
The foundations
| Package | What it is |
|---|---|
MessagePassingRulesBase | How nodes, rules, average energies, algorithms and dependencies are declared and found: @define_factor_node, @define_message_update_rule, find_message_rule, and calling a rule by hand |
MessagePassingRulesTestUtils | Testing rules: tables of cases, @test_message_update_rule, verification against a node's definition, comparisons with a reference, and the rule-coverage gate |
MessagePassingRulesApproximations | Numerics for propagating moments through functions: the unscented transform, linearisation, Gauss–Hermite cubature and Rauch–Tung–Striebel smoothing; no node |
The nodes
| Package | Nodes |
|---|---|
StandardMessagePassingRules | The standard nodes: the distributions (normal, gamma, Wishart, Bernoulli, categorical, …), arithmetic (+, -, * and dot), logic (AND, OR, NOT, IMPLY) the mixtures (Mixture, NormalMixture, GammaMixture) and Probit, a binary output through the normal CDF, by expectation propagation |
DeltaMessagePassingRules | DeltaFn, a deterministic function of its inputs, under DeltaApproximation: unscented, linearised, or projected with CVI |
GaussianCouplingMessagePassingRules | GaussianCoupling, the edge potential of Gaussian belief propagation |
GCVMessagePassingRules | GCV, a normal whose log-variance is linear in its inputs |
SoftDotMessagePassingRules | SoftDot, a dot product with Gaussian noise |
AutoregressiveMessagePassingRules | AR and ConjugateAR, autoregressive processes, under ARVMP, which a model must give |
ContinuousTransitionMessagePassingRules | ContinuousTransition, a transition through a matrix built from a vector, under CTVMP |
PolyaMessagePassingRules | BinomialPolya and MultinomialPolya, Pólya-Gamma augmented regressions. GPL-3 licensed, through PolyaGammaHybridSamplers |
BIFMMessagePassingRules | BIFM and BIFMHelper, a linear state-space time slice for backward-information-filter forward-marginal smoothing; no free energy |
FlowMessagePassingRules | Flow, an invertible transformation, with its flow models, layers and PermutationMatrix |
DiscreteTransitionMessagePassingRules | DiscreteTransition, a categorical transition through a tensor with any number of conditioning categoricals |
Every package but PolyaMessagePassingRules is MIT licensed.
Using a package
A model loads the packages of the nodes it uses, next to the engine or next to RxInfer. A model with normal distributions and a nonlinear function, for example, loads StandardMessagePassingRules for the normal node and DeltaMessagePassingRules for DeltaFn. The engine then finds the rules of both. RxInfer's documentation shows such models in full. RxInfer itself loads the packages of the nodes most models use: Standard, Delta, Autoregressive, DiscreteTransition, GCV, GaussianCoupling and SoftDot. A model that uses ContinuousTransition, Pólya, BIFM or Flow loads that package next to RxInfer.
A node whose algorithm carries settings, or has no default, receives its algorithm at activation (see The algorithm). A new node and its rules can live in a package of their own, on the same template. The package declares the node and its rules with the base package's macros, as the example node does, and tests them with MessagePassingRulesTestUtils. Your first node walks through it.