Message Passing/Belief Propagation CMSC 691 UMBC
Markov Random Fields: Undirected Graphs clique : subset of nodes, where nodes are pairwise connected maximal clique : a clique that cannot add a node and remain a clique π π¦ 1 , π¦ 2 , π¦ 3 , β¦ , π¦ π = 1 π ΰ· π π· π¦ π π· variables part Q : What restrictions should we of the clique C place on the potentials π π· ? global normalization maximal potential function (not A : π π· β₯ 0 (or π π· > 0 ) cliques necessarily a probability!)
Terminology: Potential Functions π π¦ 1 , π¦ 2 , π¦ 3 , β¦ , π¦ π = 1 π ΰ· π π· π¦ π π· energy function (for clique C) (get the total energy of a configuration by summing the individual energy functions) π π· π¦ π = exp βπΉ(π¦ π· ) Boltzmann distribution
MRFs as Factor Graphs Undirected graphs: G=(V,E) that represents π(π 1 , β¦ , π π ) Factor graph of p : Bipartite graph of evidence nodes X, factor nodes F, and edges T Evidence nodes X are the random variables Factor nodes F take values associated with the potential functions Edges show what variables are used in which factors
MRFs as Factor Graphs Undirected graphs: G=(V,E) that X represents π(π 1 , β¦ , π π ) Factor graph of p : Bipartite graph of evidence nodes X, Y Z factor nodes F, and edges T Evidence nodes X are the random variables X Factor nodes F take values associated with the potential functions Y Z Edges show what variables are used in which factors
Outline Message Passing: Graphical Model Inference Example: Linear Chain CRF
Two Problems for Undirected Models π π¦ 1 , π¦ 2 , π¦ 3 , β¦ , π¦ π = 1 π ΰ· π π· π¦ π π· Finding the normalizer Computing the marginals Sum over all variable combinations, with the x n coordinate fixed π π (π€) = ΰ· ΰ· π π (π¦ π ) π = ΰ· ΰ· π π (π¦ π ) π¦:π¦ π =π€ π π¦ π Example: 3 variables, fix the 2 nd dimension π 2 (π€) = ΰ· ΰ· ΰ· π π (π¦ = π¦ 1 , π€, π¦ 3 ) π¦ 1 π¦ 3 π
Two Problems for Undirected Models π π¦ 1 , π¦ 2 , π¦ 3 , β¦ , π¦ π = 1 π ΰ· π π· π¦ π π· Finding the normalizer Computing the marginals Sum over all variable combinations, with the x n coordinate fixed π π (π€) = ΰ· ΰ· π π (π¦ π ) π = ΰ· ΰ· π π (π¦ π ) π¦:π¦ π =π€ π π¦ π Example: 3 Q : Why are these difficult? variables, fix the 2 nd dimension A : Many different combinations π 2 (π€) = ΰ· ΰ· ΰ· π π (π¦ = π¦ 1 , π€, π¦ 3 ) π¦ 1 π¦ 3 π
Message Passing: Count the Soldiers If you are the front soldier in the line, say the number βoneβ to the soldier behind you. If you are the rearmost soldier in the line, say the number βoneβ to the soldier in front of you. If a soldier ahead of or behind you says a number to you, add one to it, and say the new number to the soldier on the other side ITILA, Ch 16
Message Passing: Count the Soldiers If you are the front soldier in the line, say the number βoneβ to the soldier behind you. If you are the rearmost soldier in the line, say the number βoneβ to the soldier in front of you. If a soldier ahead of or behind you says a number to you, add one to it, and say the new number to the soldier on the other side ITILA, Ch 16
Message Passing: Count the Soldiers If you are the front soldier in the line, say the number βoneβ to the soldier behind you. If you are the rearmost soldier in the line, say the number βoneβ to the soldier in front of you. If a soldier ahead of or behind you says a number to you, add one to it, and say the new number to the soldier on the other side ITILA, Ch 16
Message Passing: Count the Soldiers If you are the front soldier in the line, say the number βoneβ to the soldier behind you. If you are the rearmost soldier in the line, say the number βoneβ to the soldier in front of you. If a soldier ahead of or behind you says a number to you, add one to it, and say the new number to the soldier on the other side ITILA, Ch 16
Sum-Product Algorithm Main idea: message passing An exact inference algorithm for tree-like graphs Belief propagation (forward-backward for HMMs) is a special case
Sum-Product definition of π π¦ π = π€ = ΰ· π π¦ 1 , π¦ 2 , β¦ , π¦ π , β¦ , π¦ π marginal π¦:π¦ π =π€ β¦ β¦
Sum-Product definition of π π¦ π = π€ = ΰ· π π¦ 1 , π¦ 2 , β¦ , π¦ π , β¦ , π¦ π marginal π¦:π¦ π =π€ main idea : use bipartite nature of graph to efficiently compute the marginals β¦ β¦ The factor nodes can act as filters
Sum-Product definition of π π¦ π = π€ = ΰ· π π¦ 1 , π¦ 2 , β¦ , π¦ π , β¦ , π¦ π marginal π¦:π¦ π =π€ main idea : use bipartite nature of graph to efficiently compute the marginals π π 2 βπ β¦ β¦ π π 1 βπ π π 3 βπ π πβπ is a message from factor node m to evidence node n
Sum-Product Ο π π πβπ¦ π (π¦ π = π€) alternative π π¦ π = π€ = πβπ¦ π (π¦ π = π₯) β ΰ· π πβπ¦ π (π¦ π ) marginal Ο π₯ Ο π π computation π main idea : use bipartite nature of graph to efficiently compute the marginals π π 2 βπ β¦ β¦ π π 1 βπ π π 3 βπ π πβπ is a message from factor node m to evidence node n
Sum-Product π πβπ is a message from evidence node n to factor node m π πβ π 2 π π 2 βπ π πβ π 1 β¦ π πβ π 3 β¦ π π 1 βπ π π 3 βπ π πβπ is a message from factor node m to evidence node n
Sum-Product From variables to factors m n aggregates information π πβπ π¦ π = from the rest of its graph via its neighbors n
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if empty product
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if From factors to variables empty product m m aggregates information π πβπ π¦ π = from the rest of its graph via its neighbors n
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if From factors to variables empty product m m aggregates information from the π πβπ π¦ π = rest of its graph via its neighbors But these neighbors are R.V.s n that take on different values
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if From factors to variables empty product 1. sum over configuration of m variables for the m th factor, π πβπ π¦ π = with variable n fixed 2. aggregate info those other n variables provide about the rest of the graph
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if From factors to variables empty product π πβπ π¦ π m = ΰ· π π π π ΰ· π π β² βπ (π¦ πβ² ) π β² βπ(π)\π π π \π n 1. sum over configuration of 2. aggregate info those variables for the m th factor, other variables provide with variable n fixed about the rest of the graph
Sum-Product From variables to factors m π πβπ π¦ π = ΰ· π π β² βπ π¦ π π β² βπ(π)\π n set of factors in which variable n participates default value of 1 if From factors to variables empty product π πβπ π¦ π m = ΰ· π π π π ΰ· π π β² βπ (π¦ πβ² ) π β² βπ(π)\π π π \π n sum over configuration of set of variables that the variables for the m th factor, m th factor depends on with variable n fixed
Meaning of the Computed Values From variables to factors π¦ π telling factor m the π πβπ π¦ π = ΰ· π π β² βπ π¦ π βgoodnessβ for the rest of π β² βπ(π)\π the graph if π¦ π has a particular value From factors to variables π πβπ π¦ π factor m telling π¦ π the βgoodnessβ for the rest of = ΰ· π π π π ΰ· π π β² βπ (π¦ πβ² ) the graph if π¦ π has a π β² βπ(π)\π π π \π particular value
From Messages to Variable Beliefs m 1 m 2 π π 1 βπ π¦ π tells π¦ π π π 2 βπ π¦ π tells π¦ π the βgoodnessβ from the βgoodnessβ from m 1 βs perspective if π¦ π m 2 βs perspective if π¦ π has a particular value has a particular value n
Recommend
More recommend