60 likes | 184 Views
Soru1: 99 elemanlı bir dizinin mod , medyan ve ortalamasını bulan program yazınız. void medyan( int cevap[]) { int j; siralama (cevap); printf ( " nMedyan : %d n",cevap [ BOYUT / 2 ] ); } void siralama ( int dizi[]) { int i,j,enK,yedek ;
E N D
Inference Probabilistic Graphical Models Variable Elimination Graph-Based Perspective
Initial Graph C C I I D D D D G G S S L L J J H H
Elimination as Graph Operation C • Eliminate: C I D D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: D I D D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: I I D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: H I D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: G I D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: L,S I D G S L J H Induced Markov network for the current set of factors
Elimination as Graph Operation C • Eliminate: L,S I D G S L J H Induced Markov network for the current set of factors
Induced Graph C • The induced graph I, over factors and ordering : • Undirected graph • Xi and Xj are connected if they appeared in the same factor in a run of the VE algorithm using as the ordering I D D G S L J H
Cliques in the Induced Graph C • Theorem: Every factor produced during VE is a clique in the induced graph I D D G S L J H
Cliques in the Induced Graph C • Theorem: Every (maximal) clique in the induced graph is a factor produced during VE I D D G S L J H
Cliques in the Induced Graph C • Theorem: Every (maximal) clique in the induced graph is a factor produced during VE I D D G S L J H
Induced Width • The width of an induced graphis the number of nodes in the largest clique in the graph minus 1 • Minimal induced width of a graph K is min(width(IK,)) • Provides a lower bound on best performance of VE to a model factorizing over K
Finding Elimination Orderings • Theorem: For a graph H, determining whether there exists an elimination ordering for H with induced width K is NP-complete • Note:This NP-hardness result is distinct from the NP-hardness result of inference • Even given the optimal ordering, inference may still be exponential
Finding Elimination Orderings • Greedy search using heuristic cost function • At each point, eliminate node with smallest cost • Possible cost functions: • min-neighbors: # neighbors in current graph • min-weight: weight (# values) of factor formed • min-fill: number of new fill edges • weighted min-fill: total weight of new fill edges (edge weight = product of weights of the 2 nodes)
Finding Elimination Orderings A • Theorem: The induced graph is triangulated • No loops of length > 3 without a “bridge” • Can find elimination ordering by finding a low-width triangulation of original graph H D B C
Square Root SAM, F. Dellaert and M. Kaess, IJRR, 2006 Robot Localization & Mapping
Robot Localization & Mapping ... x x x x x x 0 1 2 t 3 4 robot pose L1 z z z z z 1 2 t 3 4 L2 sensor observation L3
Square Root SAM, F. Dellaert and M. Kaess, IJRR, 2006 Robot Localization & Mapping
Square Root SAM, F. Dellaert and M. Kaess, IJRR, 2006 Eliminate Poses then Landmarks
Square Root SAM, F. Dellaert and M. Kaess, IJRR, 2006 Eliminate Landmarks then Poses
Square Root SAM, F. Dellaert and M. Kaess, IJRR, 2006 Min-Fill Elimination
Summary • Variable elimination can be viewed in terms of transformations on undirected graph • Eliminating Z connects its current neighbors • Sizes of cliques in resulting induced graph directly correspond to algorithm’s complexity • Keeping induced graph simple provides useful heuristics for selecting elimination ordering