760 likes | 875 Views
Recursive Conditioning Adnan Darwiche Computer Science Department UCLA. Decomposition. Battery Age. Alternator. Fan Belt. Leak. Charge Delivered. Battery. Fuel Line. Starter. Gas. Distributor. Battery Power. Spark Plugs. Gas Gauge. Engine Start. Lights. Engine Turn Over. Radio.
E N D
Recursive ConditioningAdnan DarwicheComputer Science DepartmentUCLA
Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Engine Start Lights Engine Turn Over Radio
Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Engine Start Lights Engine Turn Over Radio
Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Engine Start Lights Engine Turn Over Radio
Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Lights Engine Start Engine Turn Over Radio LP * RP
Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Lights Engine Start Engine Turn Over Radio LP * RP
Causal Network Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Engine Start Lights Engine Turn Over Radio
Causal Network Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Engine Start Lights Engine Turn Over Radio
Case Analysis Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Charge Delivered Battery Fuel Line Battery Fuel Line Starter Starter Gas Distributor Gas Distributor Battery Power Battery Power Spark Plugs Spark Plugs Gas Gauge Gas Gauge Lights Engine Start Engine Turn Over Radio Lights Engine Start Engine Turn Over Radio Case I Case II
Case Analysis Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Charge Delivered Battery Fuel Line Battery Fuel Line Starter Starter Gas Distributor Gas Distributor Battery Power Battery Power Spark Plugs Spark Plugs Gas Gauge Gas Gauge Lights Engine Start Engine Turn Over Radio Lights Engine Start Engine Turn Over Radio Case I Case II LP * RP
Case Analysis Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Charge Delivered Battery Fuel Line Battery Fuel Line Starter Starter Gas Distributor Gas Distributor Battery Power Battery Power Spark Plugs Spark Plugs Gas Gauge Gas Gauge Lights Engine Start Engine Turn Over Radio Lights Engine Start Engine Turn Over Radio Case I Case II + LP * RP LP * RP
Case Analysis Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Lights Engine Start Engine Turn Over Radio + LP * RP LP * RP
Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Charge Delivered Battery Fuel Line Battery Fuel Line Starter Starter Gas Distributor Gas Distributor Battery Power Battery Power Spark Plugs Spark Plugs Gas Gauge Gas Gauge Lights Engine Start Engine Turn Over Radio Lights Engine Start Engine Turn Over Radio • Decomposition and Case Analysis can answer any query • Non-Deterministic!
A B C D E A B B C A B C D E D Decomposition Tree B
A C D Decomposition Tree A B C D E B B B C A B E D
A C D Decomposition Tree A B C D E B B C A E D
A B B C A C D Decomposition Tree A B C D E B B E D
A C D Decomposition Tree A B C D E B B B C A B E D
A C D Decomposition Tree A B C D E B LP RP B C A E D
A C D Decomposition Tree A B C D E LP * RP B B B C A B E D
A C D Decomposition Tree A B C D E LP * RP B B B C A B E D
A C D Decomposition Tree A B C D E LP * RP B LP RP B C A E D
A C D Decomposition Tree A B C D E LP * RP LP * RP B B B C A B E D
A B B C A C D Decomposition Tree A B C D E LP * RP + LP * RP B E D
E • Vars A B C D • Cutset B • Context B B AB BCDE • Cluster A C A AB BC BC BCDE D CD BDE Dtrees Generation from • Elimination orders • Jointree • hMeTiS hypergraph partitioning program
RC1 RC1(T,e) if T is a leaf node return Lookup(T,e) else p := 0 for each instantiation c of cutset(T)-E do p := p + RC1(Tl,ec) RC1(Tr,ec) return p
Lookup(T,e) QX|U : CPT associated with leaf T If X is instantiated in e, then x: value of X in e u: value of U in e Return qx|u Else return 1 = Sx qx|u
A B C D E C D A B B C A B C D E D Computational Complexity B B A BC BCD Ancestoral Cutset
Computational Complexity • Given • DAG with n nodes • elimination order of width w • Can construct a dtree in O(n log n) time: • Height O(log n) • cutset width <= w+1 • a-cutset width O(w log n) • Time complexity: O(n cw log n) • Cutset Conditioning: O(n cs)
Time: O(n cwlog n) Space: O(n cw) Space: O(n) Relation to Jointrees Time: O(n cw)
A B C D E F A B B C A C D E D E F Decomposition Tree A B C A B C
A B C D E F ABC ABC ABC C ABC C ABC ABC A B B C A ABC ABC Decomposition Tree A B C .27 A B C .39 C D E F D E Context(N)= A-Cutset(N)&Vars(N)
A B C D E F A B B C A D C E D E F Decomposition Tree A A B B C D C E D
RC2 RC2(T,e) if T is a leaf node, return Lookup(T,e) y := instantiation of context(T) If cacheT[y] <> nil, return cacheT[y] p := 0 for each instantiation c of cutset(T)-E do p := p + RC2(Tl,ec) RC2(Tr,ec) cacheT[y] := p return p
A B C D E D F BC A A AB AC ABE BCD DF Constructing dtrees F E A B C D W=2 Cutset <= w+1
D BC A A AB AC ABE BCD DF Constructing dtrees A B C F E A B C D W=2 D E F
A AB AC ABE BCD DF Constructing dtrees A B C F E A B C D W=2 D E D F BC A
D BC A A AB AC ABE BCD DF Constructing dtrees A F E A B C D W=2 B C D E F
A B C D E D F BC A A AB AC ABE BCD DF Constructing dtrees F E A B C D W=2 Space: O(n cw) D Context <= w+1 BC ABC AB
A B C D E F A AB AC ABE BCD DF Constructing dtrees F E A B C D W=2 Space: O(n cw) D Time: O(n cw) BCD Cluster <= w+1 ABC AB ABC
A B C D E F Constructing dtrees F E A B C D W=2 BCD Cluster <= w+1 ABC ABE DF
Graphical Models Jointree Elimination Order Dtree
Hypergraph partitioning A hypergraph is a generalization of a graph, such that an edge is permitted to connect an arbitrary number of vertices, rather than exactly two. The problem of hypergraph partitioning is well-studied in VLSI design. ….and is alive! The task of hypergraph partitioning is to find a way to split the vertices of a hypergraph into k approximately equal parts, such that the number of hyperedges connecting vertices in different parts is minimized.
An algorithm using hypergraph partitioning to construct dtrees For DAG: • Given a DAG G, we first generate a hypergraph H that corresponds to G: • For each family F in G, we add a node NF to H. • For each variable V in G, we add a hyperedge to H which connects all nodes NF such that V is a member of F. A AB BC CD • Then we recursively invoke hypergraph partitioning to build a dtree: • The algorithm partitions the hypergraph into two sets of vertices, then recursively generates dtrees for each set, and finally combines the resulting dtrees into a new dtree (whose left child is the dtree for the first set, and whose right child is the dtree for the second set). A AB BC CD BC CD A AB
A DF B C A G D E DFG B F E AB ABD H C G H A AF EFH AC ACE From dtrees to elimination orders
16 128 8 64 512 8 1024 32 1728 cache entries Time-Space Tradeoffs 64 cache entries
Cache Factors 0 1 .45 .8 0 0 1 .9 cf(T) : [0,1]
RC RC(T,e) if T is a leaf node, return Lookup(T,e) y := instantiation of context(T) If cacheT[y] <> nil, return cacheT[y] p := 0 for each instantiation c of cutset(T)-E do p := p + RC(Tl,ec) RC(Tr,ec) If cacheT[y]? then cacheT[y] := p return p