750 likes | 1.06k Views
Junction Tree Algorithm. Brookes Vision Reading Group. Outline. Graphical Models What are Graphical Models ? Conditional Independence Inference Junction Tree Algorithm Moralizing a graph Junction Tree Property Creating a junction tree Inference using junction tree algorithm .
E N D
Junction Tree Algorithm Brookes Vision Reading Group
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Don’t we all know … • P(A) = 1 , if and only if A is certain • P(A or B) = P(A)+P(B) if and only if A and B are mutually exclusive • P(A,B) = P(A|B)P(B) = P(B|A)P(A) • Conditional Independence • A is conditionally independent of C given B • P(A|B,C) = P(A|B)
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Graphical Models Compact graphical representation of joint probability. A A ‘causes’ B B P(A,B) = P(A)P(B|A)
Graphical Models Compact graphical representation of joint probability. A B ‘causes’ A B P(A,B) = P(B)P(A|B)
Graphical Models Compact graphical representation of joint probability. A B P(A,B)
A Simple Example P(A,B,C) = P(A)P(B,C | A) = P(A) P(B|A) P(C|B,A) = P(A) P(B|A) P(C|B) C is conditionally independent of A given B Graphical Representation ???
A B C Bayesian Network Directed Graphical Model P(U) = P(Vi | Pa(Vi)) P(A,B,C) = P(A) P(B | A) P(C | B)
A B C Markov Random Fields Undirected Graphical Model
Markov Random Fields Undirected Graphical Model AB BC B Clique Separator Clique P(U) = P(Clique) / P(Separator) P(A,B,C) = P(A,B) P(B,C) / P(B)
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Bayesian Networks • A is conditionally independent of B given C • Bayes ball cannot reach A from B
Markov Random Fields • A, B, C - (set of) nodes • C is conditionally independent of A given B • All paths from A to C go through B
Markov Random Fields A node is conditionally independent of all others given its neighbours.
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
MAP Estimation c*,s*,r*,w* = argmax P(C=c,S=s,R=r,W=w)
Computing Marginals P(W=w) = c,s,r P(C=c,S=s,R=r,W=w)
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Aim • To perform exact inference efficiently • Transform the graph into an appropriate data structure • Ensure joint probability remains the same • Ensure exact marginals can be computed
Junction Tree Algorithm • Converts Bayes Net into an undirected tree • Joint probability remains unchanged • Exact marginals can be computed • Why ??? • Uniform treatment of Bayes Net and MRF • Efficient inference is possible for undirected trees
Junction Tree Algorithm • Converts Bayes Net into an undirected tree • Joint probability remains unchanged • Exact marginals can be computed • Why ??? • Uniform treatment of Bayes Net and MRF • Efficient inference is possible for undirected trees
Let us recap .. Shall we A B C D P(U) = P(Vi | Pa(Vi)) = a(Vi , Pa(Vi)) Potential Lets convert this to an undirected graphical model
The cliques of this graph are inconsistent with the original one. Node D just lost a parent. Let us recap .. Shall we A B C D Wait a second …something is wrong here.
Marry the parents for a happy family Solution A B C D Ensure that a node and its parents are part of the same clique Now you can make the graph undirected
Solution A B C D But we have added extra edges, haven’t we ??? A few conditional independences are lost.
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Moralizing a graph • Marry all unconnected parents • Drop the edge directions Ensure joint probability remains the same.
Clique Potentials a(Ci) Separator Potentials a(Si) Moralizing a graph C S R Initialize a(Ci) = 1 a(Si) = 1 W CSR SR SRW
Choose one node Vi Find one clique Ci containing Vi and Pa(Vi) Moralizing a graph C S R W Multiply a(Vi,Pa(Vi)) to a(Ci) CSR Repeat for all Vi SR SRW
Moralizing a graph C Choose one node Vi S R Find one clique Ci containing Vi and Pa(Vi) W Multiply a(Vi,Pa(Vi)) to a(Ci) CSR Repeat for all Vi SR SRW
Moralizing a graph C Choose one node Vi S R Find one clique Ci containing Vi and Pa(Vi) W Multiply a(Vi,Pa(Vi)) to a(Ci) CSR Repeat for all Vi SR SRW
Moralizing a graph C Choose one node Vi S R Find one clique Ci containing Vi and Pa(Vi) W Multiply a(Vi,Pa(Vi)) to a(Ci) CSR Repeat for all Vi SR SRW
Moralizing a graph P(U) = a(Ci) / a(Si) Now we can form a tree with all the cliques we chose. That was easy. We’re ready to marginalize. OR ARE WE ???
A few more examples … A B A B C D C D
A few more examples … A B A B C D C D
Inconsistency in C A few more examples … AB BD AB BCD Clearly we’re missing something here AC CD
Outline • Graphical Models • What are Graphical Models ? • Conditional Independence • Inference • Junction Tree Algorithm • Moralizing a graph • Junction Tree Property • Creating a junction tree • Inference using junction tree algorithm
Junction Tree Property In a junction tree, all cliques in the unique path between cliques Ci and Cj must contain CiCj So what we want is a junction tree, right ??? Q. Do all graphs have a junction tree ??? A. NO
Decomposable Graphs Decomposition (A,B,C) A C B Undirected graph G = (V,E) • V = A B C • All paths between A and B go through C • C is a complete subset of V
Decomposable Graphs • A, B and/or C can be empty • A, B are non-empty in a proper decomposition
Decomposable Graphs • G is decomposable if and only if • G is complete OR • It possesses a proper decomposition (A,B,C) such that • GAC is decomposable • GBC is decomposable
Decomposable Graphs A B A B C D C D Decomposable Not Decomposable
Decomposable Graphs A A B C B C D E D E Decomposable Not Decomposable
An Important Theorem Theorem: A graph G has a junction tree if and only if it is decomposable. Proof on white board.
Time for more definitions • Chord of a cycle • An edge between two non-successive nodes • Chordless cycle • A cycle with no chords • Triangulated graph • A graph with no chordless cycles
Another Important Theorem Theorem: A graph G is decomposable if and only if it is triangulated. Proof on white board. Alright. So add edges to triangulate the graph.