Reasoning Under Uncertainty: Variable elimination - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Reasoning Under Uncertainty: Variable elimination

Description:

Construct a factor for each conditional probability of the Bnet. ... Multiply the factors and for each of the other variables Zi {Z1, ..., Zk }, sum out Zi ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 32
Provided by: con81
Category:

less

Transcript and Presenter's Notes

Title: Reasoning Under Uncertainty: Variable elimination


1
Reasoning Under Uncertainty Variable
elimination Computer Science cpsc322, Lecture
30 (Textbook Chpt 10.4) March, 28, 2008
2
Lecture Overview
  • Recap Intro Variable Elimination
  • Variable Elimination
  • Simplifications
  • Example
  • Independence
  • Where are we?

3
Last Lecture Summary
Computing P(Z Y1v1 ? ? Yjvj ) can be
reduced to computing P(Z ? Y1v1 ? ? Yjvj )
The computation of P(Z ? Y1v1 ? ? Yjvj )
can be expressed in terms of factors and the
three basic operations between factors
  • Bnet inference as variable elimination
    (preliminary)
  • Construct a factor for each conditional
    probability of the Bnet.
  • In each factor assign the observed variables to
    their observed values.
  • Multiply the factors and for each of the other
    variables Zi ? Z1, , Zk , sum out Zi

4
Variable Elimination Intro
  • Using the chain rule and the definition of a
    belief network, we can write P(X1, , Xn) as
  • Thus

Consider each CPT as a factor Inference in
belief networks thus reduces to computing the
sums of products.
5
Lecture Overview
  • Recap Intro Variable Elimination
  • Variable Elimination
  • Simplifications
  • Example
  • Independence
  • Where are we?

6
How to simplify the Computation?
  • Assume we have turned the CPTs into factors and
    performed the assignments
  • Lets focus on the basic case.

7
How to simplify basic case
  • Lets focus on the basic case.
  • How can we compute efficiently?

Factor out those terms that don't involve Z1 !
8
General case Summing out variables efficiently
  • Now to sum out a variable Z2 from a product f1
    fi f of factors, again partition the factors
    into
  • those that don't contain Z2
  • those that contain Z2

9
Analogy with Computing sums of products
  • This simplification is similar to what you can do
    in basic algebra with and x
  • It takes 14 multiplications or additions to
    evaluate the expression
  • a b a c a d a e h a f h a g h.
  • How can this expression be evaluated more
    efficiently?

10
Variable elimination algorithm Summary
  • To compute P(Q Y1v1 , ,Yjvj )
  • Construct a factor for each conditional
    probability.
  • Set the observed variables to their observed
    values.
  • For each of the other variables Zi ? Z1, , Zk
    , sum out Zi
  • Multiply the remaining factors.
  • Normalize by dividing the resulting factor f(Q)
    by ?Q f(Q) .

11
Lecture Overview
  • Recap Intro Variable Elimination
  • Variable Elimination
  • Simplifications
  • Example
  • Independence
  • Where are we?

12
Variable elimination example
  • Compute P(G Hh1 ).
  • P(G,H) ?A,B,C,D,E,F,I P(A,B,C,D,E,F,G,H,I)

13
Variable elimination example
  • Compute P(G Hh1 ).
  • P(G,H) ?A,B,C,D,E,F,I P(A,B,C,D,E,F,G,H,I)
  • Chain Rule
  • P(G,H) ?A,B,C,D,E,F,I P(A)P(BA)P(C)P(DB,C)P(E
    C)P(FD)P(GF,E)P(HG)P(IG)

14
Variable elimination example
  • Compute P(G Hh1 ).
  • P(G,H) ?A,B,C,D,E,F,I P(A)P(BA)P(C)P(DB,C)P(E
    C)P(FD)P(GF,E)P(HG)P(IG)
  • Factorized Representation
  • P(G,H) ?A,B,C,D,E,F,I f0(A) f1(B,A) f2(C)
    f3(D,B,C) f4(E,C) f5(F, D) f6(G,F,E) f7(H,G)
    f8(I,G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

15
Variable elimination example
  • Compute P(G Hh1 ).
  • Previous state
  • P(G,H) ?A,B,C,D,E,F,I f0(A) f1(B,A) f2(C)
    f3(D,B,C) f4(E,C) f5(F, D) f6(G,F,E) f7(H,G)
    f8(I,G)
  • Observe H
  • P(G,Hh1) ?A,B,C,D,E,F,I f0(A) f1(B,A) f2(C)
    f3(D,B,C) f4(E,C) f5(F, D) f6(G,F,E) f9(G)
    f8(I,G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)
  • f9(G)

16
Variable elimination example
  • Compute P(G Hh1 ).
  • Previous state
  • P(G,H) ?A,B,C,D,E,F,I f0(A) f1(B,A) f2(C)
    f3(D,B,C) f4(E,C) f5(F, D) f6(G,F,E) f9(G)
    f8(I,G)
  • Elimination ordering A, C, E, I, B, D, F
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B ?I f8(I,G)
    ?E f6(G,F,E) ?C f2(C) f3(D,B,C) f4(E,C) ?A f0(A)
    f1(B,A)
  • f9(G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

17
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B ?I f8(I,G)
    ?E f6(G,F,E) ?C f2(C) f3(D,B,C) f4(E,C) ?A f0(A)
    f1(B,A)
  • Eliminate A
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B f10(B) ?I
    f8(I,G) ?E f6(G,F,E) ?C f2(C) f3(D,B,C) f4(E,C)
  • f9(G)
  • f10(B)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

18
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B f10(B) ?I
    f8(I,G) ?E f6(G,F,E) ?C f2(C) f3(D,B,C) f4(E,C)
  • Eliminate C
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B f10(B) ?I
    f8(I,G) ?E f6(G,F,E) f12(B,D,E)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

19
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B f10(B) ?I
    f8(I,G) ?E f6(G,F,E) f12(B,D,E)
  • Eliminate E
  • P(G,Hh1) f9(G) ?F ?D f5(F, D) ?B f10(B)
    f13(B,D,F,G) ?I f8(I,G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

20
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state P(G,Hh1) f9(G) ?F ?D f5(F, D)
    ?B f10(B) f13(B,D,F,G) ?I f8(I,G)
  • Eliminate I
  • P(G,Hh1) f9(G) f14(G) ?F ?D f5(F, D) ?B f10(B)
    f13(B,D,F,G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

21
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state P(G,Hh1) f9(G) f14(G) ?F ?D
    f5(F, D) ?B f10(B) f13(B,D,F,G)
  • Eliminate B
  • P(G,Hh1) f9(G) f14(G) ?F ?D f5(F, D)
    f15(D,F,G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f15(D,F,G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

22
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state P(G,Hh1) f9(G) f14(G) ?F ?D
    f5(F, D) f15(D,F,G)
  • Eliminate D
  • P(G,Hh1) f9(G) f14(G) ?F f16(F, G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f15(D,F,G)
  • f16(F, G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

23
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state P(G,Hh1) f9(G) f14(G) ?F
    f16(F, G)
  • Eliminate F
  • P(G,Hh1) f9(G) f14(G) f17(G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f15(D,F,G)
  • f16(F, G)
  • f17(G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

24
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state P(G,Hh1) f9(G) f14(G) f17(G)
  • Multiply remaining factors
  • P(G,Hh1) f18(G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f15(D,F,G)
  • f16(F, G)
  • f17(G)
  • f18(G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

25
Variable elimination example
  • Compute P(G Hh1 ). Elimination ordering A, C,
    E, I, B, D, F.
  • Previous state
  • P(G,Hh1) f18(G)
  • Normalize
  • P(G Hh1) f18(G) / ?g ? dom(G) f18(G)
  • f9(G)
  • f10(B)
  • f12(B,D,E)
  • f13(B,D,F,G)
  • f14(G)
  • f15(D,F,G)
  • f16(F, G)
  • f17(G)
  • f18(G)
  • f0(A)
  • f1(B,A)
  • f2(C)
  • f3(D,B,C)
  • f4(E,C)
  • f5(F, D)
  • f6(G,F,E)
  • f7(H,G)
  • f8(I,G)

26
Lecture Overview
  • Recap Intro Variable Elimination
  • Variable Elimination
  • Simplifications
  • Example
  • Independence
  • Where are we?

27
Variable elimination and conditional independence
  • Variable Elimination looks incredibly painful for
    large graphs?
  • Did we use conditional independence?
  • Can we use it to make variable elimination
    simpler?
  • Yes, all the variables from which the query is
    conditional independent given the observations
    can be pruned from the Bnet

28
VE and conditional independence Example
  • All the variables from which the query is
    conditional independent given the observations
    can be pruned from the Bnet
  • e.g., P(G Hh1, F f1 , Cc1).
  • One last trick (no intuitive justification?) we
    can repeatedly eliminate all leaf nodes that are
    neither observed nor queried, until we reach a
    fixed point

29
Lecture Overview
  • Recap Intro Variable Elimination
  • Variable Elimination
  • Simplifications
  • Example
  • Independence
  • Where are we?

30
Course Big picture
Environment
Stochastic
Deterministic
Search
Single Action
Constraint Satisfaction (CSPs)
Decision
Logics
Search
Sequence of Actions
Constraint Satisfaction (CSPs)
Planning
31
Assignment 4
  • It was posted a week ago - due Wed April 9
  • Now you can work on all the questions except for
    the last one (on decision networks).
  • If you have not done it yet, start working on it
    ASAP!
Write a Comment
User Comments (0)
About PowerShow.com