Probabilistic Graphical Models Lecture 7 Variable Elimination - - PowerPoint PPT Presentation

probabilistic graphical models
SMART_READER_LITE
LIVE PREVIEW

Probabilistic Graphical Models Lecture 7 Variable Elimination - - PowerPoint PPT Presentation

Probabilistic Graphical Models Lecture 7 Variable Elimination CS/CNS/EE 155 Andreas Krause Announcements Homework 1 due today in class Will get back to you soon with feedback on project proposals. 2 Key questions How do we specify


slide-1
SLIDE 1

Probabilistic Graphical Models

Lecture 7 –Variable Elimination

CS/CNS/EE 155 Andreas Krause

slide-2
SLIDE 2

2

Announcements

Homework 1 due today in class Will get back to you soon with feedback on project proposals.

slide-3
SLIDE 3

3

Key questions

How do we specify distributions that satisfy particular independence properties? Representation How can we identify independence properties present in data? Learning How can we exploit independence properties for efficient computation? Inference

slide-4
SLIDE 4

4

Bayesian network inference

Compact representation of distributions over large number of variables (Often) allows efficient exact inference (computing marginals, etc.) HailFinder 56 vars ~ 3 states each ~1026 terms > 10.000 years

  • n Top

supercomputers JavaBayes applet

slide-5
SLIDE 5

5

Typical queries: Conditional distribution

Compute distribution of some variables given values for others E B A J M

slide-6
SLIDE 6

6

Typical queries: Maxizimization

MPE (Most probable explanation): Given values for some vars, compute most likely assignment to all remaining vars MAP (Maximum a posteriori): Compute most likely assignment to some variables E B A J M

slide-7
SLIDE 7

7

Hardness of inference for general BNs

Computing conditional distributions:

Exact solution: #P-complete Approximate solution:

Maximization:

MPE: NP-complete MAP: NPPP-complete

Inference in general BNs is really hard Is all hope lost?

slide-8
SLIDE 8

8

Inference

Can exploit structure (conditional independence) to efficiently perform exact inference in many practical situations For BNs where exact inference is not possible, can use algorithms for approximate inference (later this term)

slide-9
SLIDE 9

9

Potential for savings: Variable elimination!

Intermediate solutions are distributions on fewer variables! X1 X2 X3 X4 X5

slide-10
SLIDE 10

10

Variable elimination algorithm

Given BN and Query P(X | E=e) Remove irrelevant variables for {X,e} Choose an ordering of X1,…,Xn Set up initial factors: fi = P(Xi | Pai) For i =1:n, Xi ∉ {X,E}

Collect all factors f that include Xi Generate new factor by marginalizing out Xi Add g to set of factors

Renormalize P(x,e) to get P(x | e)

slide-11
SLIDE 11

11

Multiplying factors

slide-12
SLIDE 12

12

Marginalizing factors

slide-13
SLIDE 13

13

Does the order matter?

slide-14
SLIDE 14

14

Variable elimination for polytrees

slide-15
SLIDE 15

15

Complexity of variable elimination

Tree graphical models

Using correct elimination order, factor sizes do not increase! Inference in linear time!!

General graphical models

Ultimately NP-hard.. Need to understand what happens if there are loops

slide-16
SLIDE 16

16

Variable elimination with loops

R A J M L

slide-17
SLIDE 17

17

Elimination as graph transformation: Moralization

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

slide-18
SLIDE 18

18

Elimination: Filling edges

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

slide-19
SLIDE 19

19

Impact of elimination order

Different elim. order induce different graphs!

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

{G,C,D,S,I,L,H,J} {C,D,S,I,L,H,J,G}

slide-20
SLIDE 20

20

Induced graph and VE complexity

Theorem:

All factors arising in VE are defined over cliques (fully connected subgraphs) of the induced graph All maximal cliques of induced graph arise as factors in VE

Treewidth for ordering = Size of largest clique of induced graph -1 Treewidth of a graph = minimal treewidth under optimal ordering VE exponential in treewidth!

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

slide-21
SLIDE 21

21

Compact representation small treewidth?

slide-22
SLIDE 22

22

Finding the optimal elimination order

Theorem: Deciding whether there exists an elimination

  • rder with induced with at most K is NP-hard

Proof by reduction from MAX-CLIQUE

In fact, can find elimination order in time exponential in treewidth Finding optimal ordering as hard as inference… For which graphs can we find optimal elimination

  • rder?
slide-23
SLIDE 23

23

Finding optimal elimination order

For trees can find optimal ordering (saw before) A graph is called chordal if every cycle of length \geq 4 has a chord (an edge between some pair of non- consecutive nodes)

Every tree is chordal!

Can find optimal elimination ordering for chordal graphs

slide-24
SLIDE 24

24

Minimal fill heuristic

Unmark all nodes For i = 1:n

Find unmarked node X such that adding X adds fewest additional edges Set X as i-th var. in ordering Fill in edges added by eliminating X Mark X

Often very effective! In fact, finds optimal order for chordal graphs! May want to weigh by factor size

Coherence

Difficulty

Intelligence

Grade SAT Letter Job Happy

slide-25
SLIDE 25

25

Maxizimization queries

MPE (Most probable explanation): Given values for some vars, compute most likely assignment to all remaining vars E B A J M

slide-26
SLIDE 26

26

Variable elimination for MPE

X1 X2 X3 X4 X5

slide-27
SLIDE 27

27

Recovering the MPE

X1 X2 X3 X4 X5

slide-28
SLIDE 28

28

Variable elimination for MPE: Forward pass

Given BN and MLE query max P(x_1,…,x_n | E=e) Choose an ordering of X1,…,Xn Set up initial factors: fi = P(Xi | Pai) For i =1:n, Xi ∉ {X,E}

Collect all factors f that include Xi Generate new factor by maximizing over Xi Add g to set of factors

slide-29
SLIDE 29

29

Variable elimination for MPE: Backward pass

Variables x1*,…,xn* will contain MPE For i = n:1, Xi ∉ {X,E}

Take factors f1,..,fm used when eliminating Xi Plug in values xi+1*,…,xn* into these factors

slide-30
SLIDE 30

30

Maximizing factors

slide-31
SLIDE 31

31

Summary so far

Variable elimination complexity exponential in induced width for elimination ordering Finding optimal ordering is NP-hard Many good heuristics

Exact for trees, chordal graphs

Ultimately, inference is NP-hard Only difference between cond. prob. queries and MPE is vs. max Variable elimination building block for many exact and approximate inference techniques

slide-32
SLIDE 32

32

Tasks

Homework 2 due in class Wednesday Nov 4