3750 Machine earning ecture 4 Markov Random ields Milos auskrecht milos@cs.pitt.edu 5329 ennott quare 3750 dvanced Machine earning Markov random fields Probabilistic models with symmetric dependences. Typically models spatially varying quantities - potential function (defined over factors) - f is strictly positive we can rewrite the definition as: - nergy function - ibbs (oltzman) distribution - partition function 3750 dvanced Machine earning 1
raphical representation of MRs n undirected network (also called independence graph) = (, ) =1, 2,.. N correspond to random variables xample: or x i and x j appear within the same factor c variables,.. ssume the full joint of MR 3750 dvanced Machine earning Markov random fields regular lattice (sing model) rbitrary graph 3750 dvanced Machine earning 2
Markov random fields regular lattice (sing model) rbitrary graph 3750 dvanced Machine earning Markov random fields Pairwise Markov property Two nodes in the network that are not directly connected can be made independent given all other nodes 3750 dvanced Machine earning 3
Markov random fields Pairwise Markov property Two nodes in the network that are not directly connected can be made independent given all other nodes ocal Markov property set of nodes (variables) can be made independent from the rest of nodes variables given its immediate neighbors lobal Markov property vertex set is independent of the vertex set ( and are disjoint) given set if all chains in between elements in and intersect 3750 dvanced Machine earning Types of Markov random fields MRs with discrete random variables lique potentials can be defined by mapping all cliquevariable instances to R xample: ssume two binary variables, with values {a1,a2,a3} and {b1,b2} are in the same clique c. Then: a1 b1 0.5 a1 b2 0.2 a2 b1 0.1 a2 b2 0.3 a3 b1 0.2 a3 b2 0.4 3750 dvanced Machine earning 4
Types of Markov random fields aussian Markov Random ield Precision matrix Variables in x are connected in the network only if they have a nonzero entry in the precision matrix ll zero entries are not directly connected Why? 3750 dvanced Machine earning MR variable elimination inference xample: liminate 3750 dvanced Machine earning 5
actors actor: is a function that maps value assignments for a subset of random variables to R (reals) The scope of the factor: a set of variables defining the factor xample: ssume discrete random variables x (with values a1,a2, a3) and y (with values b1 and b2) actor: a1 b1 0.5 a1 b2 0.2 cope of the factor: a2 b1 0.1 a2 b2 0.3 a3 b1 0.2 a3 b2 0.4 3750 dvanced Machine earning Variables:,, actor Product a1 b1 c1 0.5*0.1 a1 b1 c2 0.5*0.6 b1 c1 0.1 b1 c2 0.6 b2 c1 0.3 b2 c2 0.4 a1 b1 0.5 a1 b2 0.2 a2 b1 0.1 a2 b2 0.3 a3 b1 0.2 a3 b2 0.4 a1 b2 c1 0.2*0.3 a1 b2 c2 0.2*0.4 a2 b1 c1 0.1*0.1 a2 b1 c2 0.1*0.6 a2 b2 c1 0.3*0.3 a2 b2 c2 0.3*0.4 a3 b1 c1 0.2*0.1 a3 b1 c2 0.2*0.6 a3 b2 c1 0.4*0.3 a3 b2 c2 0.4*0.4 3750 dvanced Machine earning 6
Variables:,, actor Marginalization a1 b1 c1 0.2 a1 b1 c2 0.35 a1 b2 c1 0.4 a1 b2 c2 0.15 a2 b1 c1 0.5 a2 b1 c2 0.1 a2 b2 c1 0.3 a2 b2 c2 0.2 a3 b1 c1 0.25 a1 c1 0.2+0.4=0.6 a1 c2 0.35+0.15=0.5 a2 c1 0.8 a2 c2 0.3 a3 c1 0.4 a3 c2 0.7 a3 b1 c2 0.45 a3 b2 c1 0.15 a3 b2 c2 0.25 3750 dvanced Machine earning MR variable elimination inference xample (cont): liminate 3750 dvanced Machine earning 7
8 3750 dvanced Machine earning MR variable elimination inference xample (cont): liminate 3750 dvanced Machine earning MR variable elimination inference xample (cont): liminate
9 3750 dvanced Machine earning MR variable elimination inference xample (cont): liminate 3750 dvanced Machine earning MR variable elimination inference xample (cont): liminate
MR variable elimination inference xample (cont): liminate 3750 dvanced Machine earning nduced graph graph induced by a specific variable elimination order: a graph extended by links that represent intermediate factors. 3750 dvanced Machine earning 10
Tree decomposition of the graph tree decomposition of a graph : tree T with a vertex set associated to every node. or all edges {v,w} : there is a set containing both v and w in T. or every v : the nodes in T that contain v form a connected subtree. 3750 dvanced Machine earning Tree decomposition of the graph tree decomposition of a graph : tree T with a vertex set associated to every node. or all edges {v,w} : there is a set containing both v and w in T. or every v : the nodes in T that contain v form a connected subtree. liques in the graph 3750 dvanced Machine earning 11
Tree decomposition of the graph tree decomposition of a graph : tree T with a vertex set associated to every node. or all edges {v,w} : there is a set containing both v and w in T. or every v : the nodes in T that contain v form a connected subtree. 3750 dvanced Machine earning Tree decomposition of the graph nother tree decomposition of a graph : tree T with a vertex set associated to every node. or all edges {v,w} : there is a set containing both v and w in T. or every v : the nodes in T that contain v form a connected subtree. 3750 dvanced Machine earning 12
Tree decomposition of the graph nother tree decomposition of a graph : tree T with a vertex set associated to every node. or all edges {v,w} : there is a set containing both v and w in T. or every v : the nodes in T that contain v form a connected subtree. 3750 dvanced Machine earning Treewidth of the graph Width of the tree decomposition: Treewidth of a graph : tw()= minimum width over all tree decompositions of. 3750 dvanced Machine earning 13
Treewidth of the graph Treewidth of a graph : tw()= minimum width over all tree decompositions of Why is it important? The calculations can take advantage of the structure and be performed more efficiently treewidth gives the best case complexity vs 3750 dvanced Machine earning Trees Why do we like trees? nference in trees structures can be done in time linear in the number of nodes in the tree 3750 dvanced Machine earning 14
onverting Ns to MRs Moral-graph []: of a bayesian network over X is an undirected graph over X that contains an edge between x and y if: There exists a directed edge between them in. They are both parents of the same node in. 3750 dvanced Machine earning Moral raphs Why moralization? 3750 dvanced Machine earning 15
hordal graphs hordal raph: an undirected graph whose minimum cycle contains 3 verticies. hordal. Not hordal. 3750 dvanced Machine earning hordal raphs Properties: There exists an elimination ordering that adds no edges. The minimal induced treewidth of the graph is equal to the size of the largest clique - 1. 3750 dvanced Machine earning 16
Triangulation The process of converting a graph into a chordal graph is called Triangulation. new graph obtained via triangulation is: 1) uaranteed to be chordal. 2) Not guaranteed to be (treewidth) optimal. There exist exact algorithms for minimal chordal graphs, and heuristic methods with a guaranteed upper bound. 3750 dvanced Machine earning hordal raphs iven a minimum triangulation for a graph, we can carry out the variable-elimination algorithm in the minimum possible time. omplexity of the optimal triangulation: inding the minimal triangulation is NP-ard. The inference limit: nference time is exponential in terms of the largest clique (factor) in. 3750 dvanced Machine earning 17
nference: conclusions We cannot escape exponential costs in the treewidth. ut in many graphs the treewidth is much smaller than the total number of variables till a problem: inding the optimal decomposition is hard ut, paying the cost up front may be worth it. Triangulate once, query many times. Real cost savings if not a bounded one. 3750 dvanced Machine earning 18