inferlo.forney.edge_elimination.infer_edge_elimination

inferlo.forney.edge_elimination.infer_edge_elimination(model: NormalFactorGraphModel)[source]

Calculates partition function using Edge Elimination.

Algorithm

Repeat the following: pick variable (edge). If it’s a self-loop, convolve (sum) the factor referencing it over one variable. If it connects two factors, convolve these two factors to get new factor, insert the new factor in factors list where first factor was, update edges which were connected to second factor to point to new factor.

Strategy for picking variable to eliminate: if there is a self-loop, pick it. Otherwise, pick edge whose elimination would result in factor with least degree.

Parameters:

model – Model, for which to compute partition function.

Returns:

Partition function.