Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recursive Conditioning Adnan Darwiche Computer Science Department UCLA.

Similar presentations


Presentation on theme: "Recursive Conditioning Adnan Darwiche Computer Science Department UCLA."— Presentation transcript:

1 Recursive Conditioning Adnan Darwiche Computer Science Department UCLA

2 Decomposition Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start

3 Decomposition Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start

4 Decomposition Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start

5 Decomposition Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start LPRP*

6 Decomposition Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start LPRP*

7 Causal Network Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start

8 Causal Network Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start

9 Case Analysis Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Case I Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Case II

10 Case Analysis Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Case I Case II LP * RP

11 Case Analysis Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Case I Case II LP * RP +

12 Case Analysis Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start LP * RP +

13 Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Battery Age AlternatorFan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Decomposition and Case Analysis can answer any query Non-Deterministic!

14 Decomposition Tree A BCDE A A B BC C D D B E B

15 A BCDE A A B BC C D D B E B

16 A BCDE A A B C C D D E B

17 A BCDE A A B BC C D D B E B

18 A BCDE A A B BC C D D B E B

19 A BCDE A A B C C D D E B LPRP

20 Decomposition Tree A BCDE A A B BC C D D B E B LP * RP

21 Decomposition Tree A BCDE A A B BC C D D B E B LP * RP

22 Decomposition Tree A BCDE A A B C C D D E B LP * RP LPRP

23 Decomposition Tree A BCDE A A B BC C D D B E B LP * RP

24 Decomposition Tree A BCDE A A B BC C D D B E LP * RP + LP * RP

25 Dtrees Generation from –Elimination orders –Jointree –hMeTiS hypergraph partitioning program aa’.60.40 bb’ a.90.10 a’.20.80 dd’ c.50 c’.40.60 ee’ bd.25.75 bd’.25.75 b’d.90.10 b’d’.05.95 cc’ b.70.30 b’.15.85 ABCD E AC B D Cutset B B BC Context Cluster Vars AAB BCDE BC CDBDE BCDE

26 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(T l,ec) RC1(T r,ec) return p

27 Lookup(T,e)  X|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  x|u Else return 1 =  x  x|u

28 Computational Complexity A BCDE A A B BC C D D B E A B C D B BC BCD Ancestoral Cutset

29 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 c w log n ) Cutset Conditioning: O(n c s )

30

31 Relation to Jointrees Time: O(n c w ) Space: O(n) Time: O(n c wlog n ) Space: O(n c w )

32 Decomposition Tree A BCDEF A A B BC C D D E E F A B C A B C

33 Decomposition Tree A BCDEF A A B BC C D D E E F A B C C C.27.39 ABC ABCABC ABCABC Context(N)= A-Cutset(N)&Vars(N)

34 Decomposition Tree A BCDEF A A B BC C D D E E F A B C D E A B C D

35 RC2 RC2(T,e) if T is a leaf node, return Lookup(T,e) y := instantiation of context(T) If cache T [y] <> nil, return cache T [y] p := 0 for each instantiation c of cutset(T)-E do p := p + RC2(T l,ec) RC2(T r,ec) cache T [y] := p return p

36 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BC A W=2 Cutset <= w+1

37 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BC A W=2

38 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BC A W=2

39 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BC A W=2

40 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BC A W=2 D BC AB ABC Context <= w+1 Space: O(n c w )

41 Constructing dtrees A D B E C F F E A B C D AABACABEBCDDF D BCD ABC W=2 ABABC Cluster <= w+1 Space: O(n c w ) Time: O(n c w )

42 Constructing dtrees A D B E C F F E A B C D ABEDF BCD ABC W=2 Cluster <= w+1

43 Graphical Models Elimination Order Jointree Dtree

44 Hypergraph partitioning The problem of hypergraph partitioning is well-studied in VLSI design. ….and is alive! 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 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.

45 An algorithm using hypergraph partitioning to construct dtrees Given a DAG G, we first generate a hypergraph H that corresponds to G: For each family F in G, we add a node N F to H. For each variable V in G, we add a hyperedge to H which connects all nodes N F such that V is a member of F. 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 CDBC A AB CDBC AAB CDBC For DAG:

46 A CB ED F HG DF ACACE EFH AAF ABABD DFG C E H A G B From dtrees to elimination orders

47 Any-Space Inference

48 32 8 16 8 64 128 1024 512 1728 cache entries 64 cache entries Time-Space Tradeoffs

49 .8 0 1.45 Cache Factors.9 1 0 0 cf(T) : [0,1]

50 RC RC(T,e) if T is a leaf node, return Lookup(T,e) y := instantiation of context(T) If cache T [y] <> nil, return cache T [y] p := 0 for each instantiation c of cutset(T)-E do p := p + RC(T l,ec) RC(T r,ec) If cache T [y]? then cache T [y] := p return p

51 calls(T)= cutset # (T p ) [cf(T p ) context # (T p ) + (1-cf(T p )) calls(T p )] When cf(T)=0 for every node T: calls(T) = cutset # (T p ) calls(T p ) When cf(T)=1 for every node T: calls(T) = cutset # (T p ) context # (T p ) = cluster # (T p ) exact count for discrete cache factors

52

53

54

55 Extension to Dgraphs Marginals B

56 Dgraph AB

57 Dgraph ABA

58 Dgraph ABABC

59 Dgraph ABABCBD

60 Number of Dtree Internal Nodes NetworkDtreeDgraph Water31122 Alarm36142 B1766 Barley47186

61 SamIam Screenshot

62 Discrete Cache Factor Search Problem –Given X MB of cache memory for RC –Find a discrete caching scheme which has a minimal running time where the amount of memory used by all the dtree node caches is no larger than X

63 Number of RC Calls Can estimate running time of RC Function of: –dtree –cache factors

64 Different Cache Factors 1 23 4567 cf=0 cf=1 cf=0 1 23 4567 1 23 4567 cf=1 cf=0 1 23 4567 cf=1 1 23 4567 cf=0 cf=1 1 23 4567 cf=0 1 23 4567 cf=1 cf=0 cf=1 1 23 4567 20 sec65 sec35 sec 75 sec80 sec90 sec 30 sec10 sec

65 Search Tree 1 23 4567 cf=? 1 23 4567 cf=0 cf=? No Caching …… 1 23 4567 cf=1 cf=? Full Caching ……

66 Cost Function 1 23 4567 cf=? 1 23 4567 cf=0 cf=? 1 23 4567 cf=1 cf=? …………

67 Cost Function 1 23 4567 cf=? 1 23 4567 cf=0 cf=? 1 23 4567 cf=1 ………… Admissible

68 Search Tree Pruning Memory-based pruning –Prune any branch which assigns more than the total memory assigned to the algorithm Cost-based pruning –Prune any node whose cost function f(n) is already larger than the current best goal node

69 3.3 MB = 28 Sec 7.6 MB = 12 Sec

70 .56 MB = 59 Sec 2.6 MB = 5.9 Sec 1 MB = 15.7 Sec.06 MB = 120 Sec

71 .19 KB = 2 Sec 2.8 KB <.01 Sec.23 KB =.7 Sec

72 22 MB = 1 Min 6.5 MB = 4 Min

73 370 MB = 22 Min 150 MB = 5.8 Hours

74 400 MB = 18 Min 75 MB = 2 Hours

75 Conclusion: Inference Alternative conditioning paradigm –condition to decompose –dtrees: decomposition policy New complexity results: –linear space: O(n c wlog n ) –any-space: O(n) ---- O(n c w ) O(n c wlog n ) ---- O(n c w )


Download ppt "Recursive Conditioning Adnan Darwiche Computer Science Department UCLA."

Similar presentations


Ads by Google