Download presentation
Presentation is loading. Please wait.
Published byJayson Farmer Modified over 9 years ago
1
Performing Bayesian Inference by Weighted Model Counting Tian Sang, Paul Beame, and Henry Kautz Department of Computer Science & Engineering University of Washington University of Washington Seattle, WA
2
Goal ► Extend success of “compilation to SAT” work for NP-complete problems to “compilation to #SAT” for #P-complete problems Leverage rapid advances in SAT technology Example: Computing permanent of a 0/1 matrix Inference in Bayesian networks (Roth 1996, Dechter 1999) ► Provide practical reasoning tool ► Demonstrate relationship between #SAT and conditioning algorithms In particular: compilation to DNNF (Darwiche 2002, 2004)
3
Contributions ► Simple encoding of Bayesian networks into weighted model counting ► Techniques for extending state-of-the-art SAT algorithms for efficient weighted model counting ► Evaluation on computationally challenging domains Outperforms join-tree methods on problems with high tree-width Competitive with best conditioning methods on problems with high degree of determinism
4
Outline ► Model counting ► Encoding Bayesian networks ► Related Bayesian inference algorithms ► Experiments Grid networks Plan recognition ► Conclusion
5
SAT and #SAT ► Given a CNF formula, SAT: find a satisfying assignment n #SAT: count satisfying assignments ► Example: (x y) (y z) 5 models: (0,1,0), (0,1,1), (1,1,0), (1,1,1), (1, 0, 0) Equivalently: satisfying probability = 5/2 3 ► Probability that formula is satisfied by a random truth assignment ► Can modify Davis-Putnam-Logemann-Loveland to calculate this value
6
DPLL for SAT DPLL(F) if F is empty, return 1 if F contains an empty clause, return 0 else choose a variable x to branch return (DPLL(F| x=1 ) V DPLL(F| x=0 )) return (DPLL(F| x=1 ) V DPLL(F| x=0 )) #DPLL for #SAT #DPLL(F)// computes satisfying probability of F if F is empty, return 1 if F contains an empty clause, return 0 else choose a variable x to branch return 0.5*#DPLL(F| x=1 ) + 0.5*#DPLL(F| x=0 ) return 0.5*#DPLL(F| x=1 ) + 0.5*#DPLL(F| x=0 )
7
Weighted Model Counting ► Each literal has a weight Weight of a model = Product of weight of its literals Weight of a formula = Sum of weight of its models WMC(F) if F is empty, return 1 if F contains an empty clause, return 0 else choose a variable x to branch return weight(x) * WMC(F| x=1 ) + return weight(x) * WMC(F| x=1 ) + weight( x) * WMC(F| x=0 ) weight( x) * WMC(F| x=0 )
8
Cachet ► State of the art model counting program (Sang, Bacchus, Beame, Kautz, & Pitassi 2004) ► Key innovation: sound integration of component caching and clause learning Component analysis (Bayardo & Pehoushek 2000 ): if formulas C 1 and C share no variables, Component analysis (Bayardo & Pehoushek 2000 ): if formulas C 1 and C 2 share no variables, BWMC (C C) = BWMC (C) * BWMC (C) BWMC (C 1 C 2 ) = BWMC (C 1 ) * BWMC (C 2 ) Caching (Majercik & Littman 1998; Darwiche 2002; Bacchus, Dalmao, & Pitassi 2003; Beame, Impagliazzo, Pitassi, & Segerland 2003) : save and reuse values of internal nodes of search tree Clause learning (Marquis-Silva 1996; Bayardo & Shrag 1997; Zhang, Madigan, Moskewicz, & Malik 2001 ) : analyze reason for backtracking, store as a new clause
9
Cachet ► State of the art model counting program (Sang, Bacchus, Beame, Kautz, & Pitassi 2004) ► Key innovation: sound integration of component caching and clause learning Naïve combination of all three techniques is unsound Can resolve by careful cache management (Sang, Bacchus, Beame, Kautz, & Pitassi 2004) New branching strategy (VSADS) optimized for counting (Sang, Beame, & Kautz SAT-2005)
10
Computing All Marginals ► Task: In one counting pass, Compute number of models in which each literal is true Equivalently: compute marginal satisfying probabilities ► Approach Each recursion computes a vector of marginals At branch point: compute left and right vectors, combine with vector sum Cache vectors, not just counts ► Reasonable overhead: 10% - 40% slower than counting
11
Encoding Bayesian Networks to Weighted Model Counting A B 0.80.2A 0.40.6 AAAA BBBBB0.1A
12
A B 0.80.2A 0.40.6 AAAA BBBBB0.1A Chance variable P added with weight(P)=0.2
13
Encoding Bayesian Networks to Weighted Model Counting A B 0.80.2A 0.40.6 AAAA BBBBB0.1A P)=0.8 and weight( P)=0.8
14
Encoding Bayesian Networks to Weighted Model Counting A B 0.80.2A 0.40.6 AAAA BBBBB0.1A Chance variable Q added with weight(Q)=0.6
15
Encoding Bayesian Networks to Weighted Model Counting A B 0.80.2A 0.40.6 AAAA BBBBB0.1A Q)=0.4 and weight( Q)=0.4
16
Encoding Bayesian Networks to Weighted Model Counting A B 0.80.2A 0.40.6 AAAA BBBBB0.1Aw(A)=0.1 w( A)=0.9 w(P)=0.2 w( P)=0.8 w(Q)=0.6 w( Q)=0.4 w(B)=1.0 w( B)=1.0
17
Main Theorem ► Let: F = a weighted CNF encoding of a Bayes net E = an arbitrary CNF formula, the evidence Q = an arbitrary CNF formula, the query ► Then:
18
Exact Bayesian Inference Algorithms ► Junction tree algorithm (Shenoy & Shafer 1990) Most widely used approach Data structure grows exponentially large in tree-width of underlying graph ► To handle high tree-width, researchers developed conditioning algorithms, e.g.: Recursive conditioning (Darwiche 2001) Value elimination (Bacchus, Dalmao, Pitassi 2003) Compilation to d-DNNF (Darwiche 2002; Chavira, Darwiche, Jaeger 2004; Darwiche 2004) ► These algorithms become similar to DPLL...
19
Techniques Method Cache index Cache value Branching heuristic Clause learning? Weighted Model Counting componentprobabilitydynamic Recursive Conditioning partial assignment probabilitystatic Value Elimination dependency set probability semi- dynamic Compiling to d-DNNF residual formula d-DNNF semi- dynamic
20
Experiments ► Our benchmarks: Grid, Plan Recognition Junction tree - Netica Recursive conditioning – SamIam Value elimination – Valelim Weighted model counting – Cachet ► ISCAS-85 and SATLIB benchmarks Compilation to d-DNNF – timings from (Darwiche 2004) Weighted model counting - Cachet
21
Experiments: Grid Networks S T ► CPT’s are set randomly. ► A fraction of the nodes are deterministic, specified as a parameter ratio. ► T is the query node
22
Results of ratio=0.5 Size Junction Tree Recursive Conditioning Value Elimination Weighted Model Counting 10*100.020.882.07.3 12*120.551.615.438 14*14217.987419 16*16X104>20,861890 18*18X2,126X13,111 10 problems of each size, X=memory out or time out
23
Results of ratio=0.75 Size Junction Tree Recursive Conditioning Value Elimination Weighted Model Counting 12*120.471.51.41.0 14*142120158.34.7 16*16>227937139 18*18X1,751>1,05381 20*20X>24,026>94,997248 22*22XXX1,300 24*24XXX4,998
24
Results of ratio=0.9 Size Junction Tree Recursive Conditioning Value Elimination Weighted Model Counting 16*162591020.550.47 18*18X11511.91.4 20*20X>44,675131.7 24*24XX844.5 26*26XX>8,01014 30*30XXX108
25
Plan Recognition ► Task: Given a planning domain described by STRIPS operators, initial and goal states, and time horizon Infer the marginal probabilities of each action ► Abstraction of strategic plan recognition: We know enemy’s capabilities and goals, what will it do? ► Modified Blackbox planning system (Kautz & Selman 1999) to create instances
26
problemvariables Junction Tree Recursive Conditioning Value Elimination Weighted Model Counting 4-step1650.168.30.030.03 5-step17756360.040.03 tire-1352XX0.680.12 tire-2550XX4.10.09 tire-3577XX240.23 tire-4812XX251.1 log-1939XX240.11 log-21337XXX7.9 log-31413XXX9.7 log-42303XXX65
27
ISCAS/SATLIB Benchmarks Benchmarks reported in (Darwiche 2004) Compiling to d-DNNF Weighted Model Counting uf200 (100 instances) 137 flat200 (100 instances) 508 c4320.10.1 c499685 c8808017,506 c1355157,057 c19081871,855
28
Summary ► Bayesian inference by translation to model counting is competitive with best known algorithms for problems with High tree-width High degree of determinism ► Recent conditioning algorithms already make use of important SAT techniques Most striking: compilation to d-DNNF ► Translation approach makes it possible to quickly exploit future SAT algorithms and implementations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.