Top Banner
Bucket Elimination: A Unifying Bucket Elimination: A Unifying Framework for Probabilistic Framework for Probabilistic Inference Inference By: Rina Dechter Presented by: Gal Lavee
44

Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Dec 22, 2015

Download

Documents

Shawna Osley
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Bucket Elimination: A Unifying Framework for Bucket Elimination: A Unifying Framework for Probabilistic InferenceProbabilistic Inference

By: Rina Dechter

Presented by:Gal Lavee

Page 2: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Multiplying TablesMultiplying Tables

• Often in inference we see the notation:

f(A) * g(B)

where A and B are sets of variables and f and g are functions (usually probability functions) given as tables of the form:

• Example: a function f of two variables: A1 and A2 Where ai and ~ai are the possible states of Ai

a1~a1

a2f(a1,a2)f(~a1,a2)

~a2f(a1,~a2)f(~a1,~a2)

Page 3: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Multiplying TablesMultiplying Tables

• Multiply the two functions (given as tables) f and g. Where g takes one variable (B1) and f takes two variables (A1,A2)

a1~a1

a2f(a1,a2)f(~a1,a2)

~a2f(a1,~a2)f(~a1,~a2)

b1~b1

g(b1)g(~b1)

Page 4: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Multiplying TablesMultiplying Tables

b1a1~a1

a2f(a1,a2)*g(b1)f(~a1,a2)*g(b1)

~a2f(a1,~a2)*g(b1)f(~a1,~a2)*g(b1)

~b1a1~a1

a2f(a1,a2)*g(~b1)f(~a1,a2)*g(~b1)

~a2f(a1,~a2)*g(~b1)f(~a1,~a2)*g(~b1)

• The result is a function h, which takes as 3 arguments (the union of the arguments of f and g), A1,A2,B1

• The value of the function h(A1,A2,B1) is simply the product f(A1,A2) * g(B1)

• This function can be expressed as a table with 2^3 entries:

Page 5: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Summing over tablesSumming over tables• Given a function of multiple variables it

is often useful to eliminate variables by summation

• Summing the function f of variables A1,A2 (given as a table) over the variable A2 yields a new function f1 of just one variable(A1).

• The new function value is given by f(A1,a2)+f(A1,~a2).

• This function can be specified as the table:

a1~a1

a2f(a1,a2)f(~a1,a2)

~a2f(a1,~a2)f(~a1,~a2)

a1~a1

f(a1,a2)+ f(a1,~a2)

f(~a1,a2)+ f(~a1,~a2)

Page 6: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Bucket Elimination-DefinitionBucket Elimination-Definition

• Bucket elimination is a unifying algorithmic framework that generalizes dynamic programming to accommodate algorithms for many complex problem-solving and reasoning activities Including:

– Belief Assessment

– Most Probable Estimation (MPE)

– Maximum A posteriori Hypothesis (MAP)

– Maximum Expected Utility MEU

• Uses “buckets”, an organizational device, to mimic the algebraic manipulations involved in each of these problems resulting in an easily expressible algorithmic formulation

• Each bucket elimination algorithm is associated with a node ordering

Page 7: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

The Bucket Elimination AlgorithmThe Bucket Elimination Algorithm

• Mimics algebraic manipulation• Partition functions on the graph into “buckets” in

backwards relative to the given node order• In the bucket of variable Xi we put all functions

that mention Xi but do not mention any variable having a higher index

• e.g. in the bucketG we will place all functions whose scope includes variable G

Page 8: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

The AlgorithmThe Algorithm cntd.cntd.

• Process buckets backwards relative to the node order

• Processing a bucket amounts to eliminating the variable in the bucket from subsequent computation.

• The computed function after elimination is placed in the bucket of the ‘highest’ variable in its scope

• E.g= sum over G is computed and placed in bucket F

Page 9: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief Updating/AssessmentExample - Belief Updating/Assessment

• Definition– Given a set of evidence compute the posterior

probability of each proposition

– The belief assessment task of Xk = xk is to find

}{ 1

)),(|()|()(kxX

n

iiikkk expaxPkexXPxbel

where k – normalizing constant

Page 10: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief Assessment

A

F

BC

D

G

Node Ordering: A,C,B,F,D,G

Page 11: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

( | ), 1

( | , )

( | , )

( | )

( | )

( )

G

D

F

B

C

A

bucket P g f g

bucket P d b a

bucket P f b c

bucket P b a

bucket P c a

bucket P a

Initial Bucket Partition

Page 12: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

1

Eliminate ( ) ( | )

( | , )

( | , ) ( )

( | )

( | )

( )

G Gg

D

F G

B

C

A

bucket f P g f

bucket P d b a

bucket P f b c f

bucket P b a

bucket P c a

bucket P a

Process buckets in reverse order (G)

Page 13: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( , ) ( | , )

( | , ) ( )

( | ) ( , )

( | )

( )

D Dd

F G

B D

C

A

bucket b a P d b a

bucket P f b c f

bucket P b a b a

bucket P c a

bucket P a

Process buckets in reverse order (D)

Page 14: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( , ) ( | , ) ( )

( | ) ( , ) ( , )

( | )

( )

F F Gf

B D F

C

A

bucket c b P f b c f

bucket P b a b a c b

bucket P c a

bucket P a

Process buckets in reverse order (F)

Page 15: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( , ) ( | ) ( , ) ( , )

( | ) ( , )

( )

B B D Fb

C B

A

bucket c a P b a b a c b

bucket P c a c a

bucket P a

Process buckets in reverse order (B)

Page 16: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( ) ( | ) ( , )

( ) ( )

C C Bc

A C

bucket a P c a c a

bucket P a a

Process buckets in reverse order (C)

Page 17: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - Belief AssessmentExample - Belief AssessmentA

F

B C

D GNode Ordering: A,C,B,F,D,G

1Eliminate Bel(a)= ( ) ( )A Cbucket P a a

Z

Process buckets in reverse order (A)

Page 18: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Belief Assessment SummaryBelief Assessment Summary

• In reverse Node Ordering:– Create bucket function by multiplying all

functions (given as tables) containing the current node

– Perform variable elimination using Summation over the current node

– Place the new created function table) into the appropriate bucket

Page 19: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Most Probable Explanation (MPE)Most Probable Explanation (MPE)

• Definition– Given evidence find the maximum probabillity

assignment to the remaining variables

– The MPE task is to find an assignment xo = (xo1,

…, xon) such that

n

iii

XexpaxPxP o

1

)),(|(max)(

Page 20: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Most Probable Explanation (MPE)Most Probable Explanation (MPE)

• Differences from Belief Assessment– Replace Sums With Maxs– Keep track of maximizing value at each stage– “Forward Step” to determine what is the

maximizing assignment tuple

Page 21: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPE

A

F

BC

D

G

Node Ordering: A,C,B,F,D,G

Page 22: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

( | ), 1

( | , )

( | , )

( | )

( | )

( )

G

D

F

B

C

A

bucket P g f g

bucket P d b a

bucket P f b c

bucket P b a

bucket P c a

bucket P a

Initial Bucket Partition (same as belief assessment)

Page 23: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

1

1

Eliminate ( ) max ( | ) ,

( ) arg max ( | )

( )

( | , )

( | , ) ( )

( | )

( | )

( )

G Gg

g

G

D

F G

B

C

A

bucket h f P g f

G f P g f

bucket G f

bucket P d b a

bucket P f b c h f

bucket P b a

bucket P c a

bucket P a

Process buckets in reverse order (G)

Page 24: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( , ) max ( | , ) ,

( , ) arg max ( | , )

( )

( , )

( | , ) ( )

( | ) ( , )

( | )

( )

D Dd

d

G

D

F G

B D

C

A

bucket h b a P d b a

D b a P d b a

bucket G f

bucket D b a

bucket P f b c h f

bucket P b a h b a

bucket P c a

bucket P a

Process buckets in reverse order (D)

Page 25: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

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

( , ) arg max ( | , ) ( )

( )

( , )

( , )

( | ) ( , ) ( , )

( | )

( )

F F Gf

Gf

G

D

F

B D F

C

A

bucket h b c P f b c h f

F b c P f b c h f

bucket G f

bucket D b a

bucket F b c

bucket P b a h b a h b c

bucket P c a

bucket P a

Process buckets in reverse order (F)

Page 26: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

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

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

( )

( , )

( , )

( , )

( | ) ( , )

( )

B B D fb

D fb

G

D

F

B

C B

A

bucket h c a P b a h b a h b c

B c a P b a h b a h b c

bucket G f

bucket D b a

bucket F b c

bucket B c a

bucket P c a h c a

bucket P a

Process buckets in reverse order (B)

Page 27: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate ( ) max ( | ) ( , ) ,

( ) arg max ( | ) ( , )

( )

( , )

( , )

( , )

( )

( ) ( )

C C Bc

Bc

G

D

F

B

C

A C

bucket h a P c a h c a

C a P c a h c a

bucket G f

bucket D b a

bucket F b c

bucket B c a

bucket C a

bucket P a h a

Process buckets in reverse order (C)

Page 28: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

Eliminate M max ( ) ( ) ,

arg max ( ) ( )

( )

( , )

( , )

( , )

( )

A Ca

Ca

G

D

F

B

C

A

bucket P a h a

A P a h a

bucket G f

bucket D b a

bucket F b c

bucket B c a

bucket C a

bucket A

Process buckets in reverse order (A)

Page 29: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MPEExample - MPEA

F

B C

D GNode Ordering: A,C,B,F,D,G

'

' ')

' ', ')

' ', ')

' ', ')

' ')

a A

c C a

b B c a

f F b c

d D b a

g G f

Forward Phase: determine maximizing tuple:

Page 30: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

MPE SummaryMPE Summary

• In reverse node Ordering– Create bucket function by multiplying all functions

(given as tables) containing the current node– Perform variable elimination using the Maximization

operation over the current node (recording the maximizing state function)

– Place the new created function table) into the appropriate bucket

• In forward node ordering– Calculate the maximum probability using maximizing

state functions

Page 31: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Maximum Aposteriori Hypothesis Maximum Aposteriori Hypothesis (MAP)(MAP)• Definition

– Given evidence find an assignment to a subset of “hypothesis” variables that maximizes their probability

– Given a set of hypothesis variables A = {A1, …, Ak},

, the MAP task is to find an assignment

ao = (ao1, …, ao

k) such that

XA

AX

n

iii

A

o expaxPaP1

)),(|(max)(

Page 32: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Maximum Aposteriori Hypothesis Maximum Aposteriori Hypothesis (MAP)(MAP)

• Mixture of Belief Assessment and MPE– Sum over non-hypothesis vars– Max over hypothesis var– Forward phase over hypothesis vars only– Algorithm presented assumes hypothesis vars

are at the beginning of the order

Page 33: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

A

F

BC

D

G

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 34: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

( | ), 1

( | , )

( | , )

( | )

( | )

( )

G

D

F

B

C

A

bucket P g f g

bucket P d b a

bucket P f b c

bucket P b a

bucket P c a

bucket P a

Initial Bucket Partition (Same as Belief Assessment, MPE)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 35: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

1

Eliminate ( ) ( | )

( | , )

( | , ) ( )

( | )

( | )

( )

G Gg

D

F G

B

C

A

bucket f P g f

bucket P d b a

bucket P f b c f

bucket P b a

bucket P c a

bucket P a

Process buckets in reverse order (G)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 36: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

Eliminate ( , ) ( | , )

( | , ) ( )

( | ) ( , )

( | )

( )

D Dd

F G

B D

C

A

bucket b a P d b a

bucket P f b c f

bucket P b a b a

bucket P c a

bucket P a

Process buckets in reverse order (D)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 37: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

Eliminate ( , ) ( | , ) ( )

( | ) ( , ) ( , )

( | )

( )

F F Gf

B D F

C

A

bucket c b P f b c f

bucket P b a b a c b

bucket P c a

bucket P a

Process buckets in reverse order (F)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 38: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

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

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

( , )

( | ) ( , )

( )

B B D fb

D fb

B

C B

A

bucket h c a P b a b a b c

B c a P b a b a b c

bucket B c a

bucket P c a h c a

bucket P a

Process buckets in reverse order (B)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 39: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

Eliminate ( ) max ( | ) ( , ) ,

( ) arg max ( | ) ( , )

( , )

( )

( ) ( )

C C Bc

Bc

B

C

A C

bucket h a P c a h c a

C a P c a h c a

bucket B c a

bucket C a

bucket P a h a

Process buckets in reverse order (C)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 40: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

Eliminate M max ( ) ( ) ,

arg max ( ) ( )

( , )

( )

A Ca

Ca

B

C

A

bucket P a h a

A P a h a

bucket B c a

bucket C a

bucket A

Process buckets in reverse order (A)

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 41: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Example - MAPExample - MAP

'

' ')

' ', ')

a A

c C a

b B c a

Forward Phase: determine maximizing tuple:

A

F

B C

DG

Node Ordering: A,C,B,F,D,G

Hypothesis Nodes: A,B,C

Page 42: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

MAP -SummaryMAP -Summary

• In reverse node Ordering– Create bucket function by multiplying all functions (given as

tables) containing the current node– If is a hypothesis node:

• Perform variable elimination using the Maximization operation over the current node (recording the maximizing state function)

– Else:• Perform variable elimination using Summation over the current

node (recording the maximizing state function)

– Place the new created function (table) into the appropriate bucket

• In forward node ordering– Calculate the maximum probability using maximizing state

functions over hypothesis nodes only

Page 43: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Generalizing Bucket EliminationGeneralizing Bucket Elimination

• As we have seen bucket elimination algorithms can be formulated for different problems by simply altering the elimination operation.

• For some problems we may also want to change the combination operation which we use to combine functions.

ProblemCombination OperatorElimination Operator

Belief AssessmentMultiplicationSummation

MPEMultiplicationMaximization

CSPJoinMultiplication

Max-CSPSummationMinimization

Page 44: Bucket Elimination: A Unifying Framework for Probabilistic Inference By: Rina Dechter Presented by: Gal Lavee.

Thank YouThank You