Expand description
General-graph CRF training via loopy belief propagation.
Supports arbitrary pairwise factor graphs (not just linear chains). Inference uses sum-product message passing; MAP uses max-product.
Reference: Koller & Friedman 2009, “Probabilistic Graphical Models”, Chapter 11 (Belief Propagation).
Graph structure:
n_nodesvariable nodes, each withn_labelspossible states.edges: Vec<(usize, usize)>— undirected pairwise edges.- Node potentials φ_i(y_i):
[n_nodes × n_labels]. - Edge potentials ψ_{ij}(y_i, y_j):
[n_edges × n_labels × n_labels].
Loopy BP is approximate for graphs with cycles. Guaranteed exact for trees and linear chains.
Structs§
- Edge
- One undirected pairwise edge in the factor graph.
- General
Graph Crf - General-graph pairwise CRF with loopy belief propagation inference.
- Graph
CrfConfig - Configuration for the general-graph CRF.