exact inference algorithms bucket-elimination

47
1 Exact Inference Algorithms Bucket-elimination COMPSCI 276, Spring 2011 Class 5: Rina Dechter (Reading: class notes chapter 4 , Darwiche chapter 6)

Upload: others

Post on 03-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Exact Inference Algorithms Bucket-elimination

1

Exact Inference Algorithms Bucket-elimination

COMPSCI 276, Spring 2011

Class 5: Rina Dechter

(Reading: class notes chapter 4 , Darwiche chapter 6)

Page 2: Exact Inference Algorithms Bucket-elimination

2

Belief Updating

lung Cancer

Smoking

X-ray

Bronchitis

Dyspnoea

P (lung cancer=yes | smoking=no, dyspnoea=yes ) = ?

Page 3: Exact Inference Algorithms Bucket-elimination
Page 4: Exact Inference Algorithms Bucket-elimination

4

Probabilistic Inference Tasks

X/A

a

*

k

*

1 e),xP(maxarg)a,...,(a

evidence)|xP(X)BEL(X iii

Belief updating: E is a subset {X1,…,Xn}, Y subset X-E, P(Y=y|E=e)

P(e)?

Finding most probable explanation (MPE)

Finding maximum a-posteriory hypothesis

Finding maximum-expected-utility (MEU) decision

e),xP(maxarg*xx

)xU(e),xP(maxarg)d,...,(d X/D

d

*

k

*

1

variableshypothesis

: XA

function utilityx

variablesdecision

: )(

:

U

XD

Page 5: Exact Inference Algorithms Bucket-elimination

5

Belief updating is NP-hard

Each sat formula can be mapped to a Bayesian network query.

Example: (u,~v,w) and (~u,~w,y) sat?

Page 6: Exact Inference Algorithms Bucket-elimination

6

Motivation

How can we compute P(D)?, P(D|A=0)? P(A|D=0)?

Brute force O(k^4)

Maybe O(4k^2)

A DB CGiven:

Page 7: Exact Inference Algorithms Bucket-elimination
Page 8: Exact Inference Algorithms Bucket-elimination
Page 9: Exact Inference Algorithms Bucket-elimination
Page 10: Exact Inference Algorithms Bucket-elimination

10

Belief updating: P(X|evidence)=?

“Moral” graph

A

D E

CB

P(a|e=0) P(a,e=0)=

bcde ,,,0

P(a)P(b|a)P(c|a)P(d|b,a)P(e|b,c)=

0e

P(a) d

),,,( ecdah B

b

P(b|a)P(d|b,a)P(e|b,c)

B C

ED

Variable Elimination

P(c|a)c

Page 11: Exact Inference Algorithms Bucket-elimination

11

Page 12: Exact Inference Algorithms Bucket-elimination

12

“Moral” graph

A

D E

CB

Page 13: Exact Inference Algorithms Bucket-elimination

13

Page 14: Exact Inference Algorithms Bucket-elimination
Page 15: Exact Inference Algorithms Bucket-elimination
Page 16: Exact Inference Algorithms Bucket-elimination
Page 17: Exact Inference Algorithms Bucket-elimination
Page 18: Exact Inference Algorithms Bucket-elimination

18

Bucket elimination Algorithm BE-bel (Dechter 1996)

b

Elimination operator

P(a|e=0)

W*=4”induced width” (max clique size)

bucket B:

P(a)

P(c|a)

P(b|a) P(d|b,a) P(e|b,c)

bucket C:

bucket D:

bucket E:

bucket A:

e=0

B

C

D

E

A

e)(a,hD

(a)hE

e)c,d,(a,hB

e)d,(a,hC

Page 19: Exact Inference Algorithms Bucket-elimination

19

BE-BEL

Page 20: Exact Inference Algorithms Bucket-elimination

IntelligenceDifficulty

Grade

Letter

SAT

Job

Apply

Student Network example

P(J)?

Page 21: Exact Inference Algorithms Bucket-elimination

21

E

D

C

B

A

B

C

D

E

A

Page 22: Exact Inference Algorithms Bucket-elimination

22

Complexity of elimination

))((exp ( * dwnO

ddw ordering along graph moral of widthinduced the)(*

The effect of the ordering:

4)( 1

* dw 2)( 2

* dw“Moral” graph

A

D E

CB

B

C

D

E

A

E

D

C

B

A

Page 23: Exact Inference Algorithms Bucket-elimination

23

More accurately: O(r exp(w*(d)) where r is the number of cpts.For Bayesian networks r=n. For Markov networks?

BE-BEL

Page 24: Exact Inference Algorithms Bucket-elimination

24

Page 25: Exact Inference Algorithms Bucket-elimination

25

The impact of observations

Induced graphOrdered graph Ordered conditioned graph

Page 26: Exact Inference Algorithms Bucket-elimination

26Use the ancestral graph only

BE-BEL

“Moral” graph

A

D E

CB

Page 27: Exact Inference Algorithms Bucket-elimination
Page 28: Exact Inference Algorithms Bucket-elimination
Page 29: Exact Inference Algorithms Bucket-elimination
Page 30: Exact Inference Algorithms Bucket-elimination
Page 31: Exact Inference Algorithms Bucket-elimination
Page 32: Exact Inference Algorithms Bucket-elimination

32

Probabilistic Inference Tasks

X/A

a

*

k

*

1 e),xP(maxarg)a,...,(a

evidence)|xP(X)BEL(X iii

Belief updating:

Finding most probable explanation (MPE)

Finding maximum a-posteriory hypothesis

Finding maximum-expected-utility (MEU) decision

e),xP(maxarg*xx

)xU(e),xP(maxarg)d,...,(d X/D

d

*

k

*

1

variableshypothesis

: XA

function utilityx

variablesdecision

: )(

:

U

XD

Page 33: Exact Inference Algorithms Bucket-elimination

33

b

maxElimination operator

MPE

W*=4”induced width” (max clique size)

bucket B:

P(a)

P(c|a)

P(b|a) P(d|b,a) P(e|b,c)

bucket C:

bucket D:

bucket E:

bucket A:

e=0

B

C

D

E

A

e)(a,hD

(a)hE

e)c,d,(a,hB

e)d,(a,hC

FindingAlgorithm elim-mpe (Dechter 1996)

)xP(maxMPEx

),|(),|()|()|()(max

by replaced is

,,,,cbePbadPabPacPaPMPE

:

bcdea max

Page 34: Exact Inference Algorithms Bucket-elimination

34

Generating the MPE-tuple

C:

E:

P(b|a) P(d|b,a) P(e|b,c)B:

D:

A: P(a)

P(c|a)

e=0 e)(a,hD

(a)hE

e)c,d,(a,hB

e)d,(a,hC

(a)hP(a)max arga' 1. E

a

0e' 2.

)e'd,,(a'hmax argd' 3. C

d

)e'c,,d',(a'h

)a'|P(cmax argc' 4.B

c

)c'b,|P(e')a'b,|P(d'

)a'|P(bmax argb' 5.b

)e',d',c',b',(a' Return

Page 35: Exact Inference Algorithms Bucket-elimination

35

Page 36: Exact Inference Algorithms Bucket-elimination

Algorithm BE-MPE

36

Page 37: Exact Inference Algorithms Bucket-elimination

37

Page 38: Exact Inference Algorithms Bucket-elimination

Algorithm BE-MAP

38

Variable ordering:Restricted: Max buckets shouldBe processed after sum buckets

Page 39: Exact Inference Algorithms Bucket-elimination

39

More accurately: O(r exp(w*(d)) where r is the number of cpts.For Bayesian networks r=n. For Markov networks?

Page 40: Exact Inference Algorithms Bucket-elimination

40

Finding small induced-width

NP-complete

A tree has induced-width of ?

Greedy algorithms:

Min width

Min induced-width

Max-cardinality

Fill-in (thought as the best)

See anytime min-width (Gogate and Dechter)

Page 41: Exact Inference Algorithms Bucket-elimination

41

Min-width ordering

Proposition: algorithm min-width finds a min-width ordering of a graph

Page 42: Exact Inference Algorithms Bucket-elimination

Greedy orderings heuristics

42

min-induced-width (miw)input: a graph G = (V;E), V = {1; :::; vn}output: An ordering of the nodes d = (v1; :::; vn).1. for j = n to 1 by -1 do2. r a node in V with smallest degree.3. put r in position j.4. connect r's neighbors: E E union {(vi; vj)| (vi; r) in E; (vj ; r) 2 in E},5. remove r from the resulting graph: V V - {r}.

min-fill (min-fill)input: a graph G = (V;E), V = {v1; :::; vn}output: An ordering of the nodes d = (v1; :::; vn).1. for j = n to 1 by -1 do2. r a node in V with smallest fill edges for his parents.3. put r in position j.4. connect r's neighbors: E E union {(vi; vj)| (vi; r) 2 E; (vj ; r) in E},5. remove r from the resulting graph: V V –{r}.

Theorem: A graph is a tree iff it has both width and induced-width of 1.

Page 43: Exact Inference Algorithms Bucket-elimination

43

Different Induced-graphs

Page 44: Exact Inference Algorithms Bucket-elimination

Fall 2003 ICS 275A - Constraint Networks 44

Min-induced-width

Page 45: Exact Inference Algorithms Bucket-elimination

Fall 2003 ICS 275A - Constraint Networks 45

Min-fill algorithm

Prefers a node who add the least number of fill-in arcs.

Empirically, fill-in is the best among the greedy algorithms (MW,MIW,MF,MC)

Page 46: Exact Inference Algorithms Bucket-elimination

Fall 2003 ICS 275A - Constraint Networks 46

Chordal graphs and Max-cardinality ordering

A graph is chordal if every cycle of length at least 4 has a chord

Finding w* over chordal graph is easy using the max-cardinality ordering

If G* is an induced graph it is chordal chord

K-trees are special chordal graphs (A graph is a k-tree if all its max-clique are of size k+1, created recursively by connection a new node to k earlier nodes in a cliques

Finding the max-clique in chordal graphs is easy (just enumerate all cliques in a max-cardinality ordering

Page 47: Exact Inference Algorithms Bucket-elimination

47

Max-cardinality ordering

Figure 4.5 The max-cardinality (MC) ordering procedure.