Infer.NET user guide : Factors and Constraints
All factors listed on this page are experimental and currently are only supported when using the MaxProductBeliefPropagation algorithm. Support for undirected models will be extended in future releases of Infer.NET.
This page lists the built-in methods for creating common undirected factors, as used in many undirected graphical models. Strictly speaking these are stochastic constraints, but we follow convention and refer to them as undirected factors. In these methods, you can usually pass in random variables as arguments e.g.
Variable<double> instead of
double. For compactness, this is not shown in the syntax below.
These methods provide a convenient short alternative to using
Variable.Constrain and passing in the undirected factor method, as described on this page.
||Adds a Potts factor between two bool random variables which evaluates to 1 if a==b and exp(-logCost) otherwise.|
||Adds a Potts factor between two int random variables which evaluates to 1 if a==b and exp(-logCost) otherwise.|
||Adds a linear factor between two int random variables which evaluates to exp(-abs(a-b)*logUnitCost).|
|Truncated linear (int)||
||Adds a truncated linear factor between two int random variables which evaluates to exp(-min(abs(a-b)*logUnitCost, maxCost)).|