52
Graphical Models - Inference - Wolfram Burgard, Luc De Raedt, Kristian Kersting, Bernhard Nebel Albert-Ludwigs University Freiburg, Germany PCWP CO HRBP HREKG HRSAT ERRCAUTER HR HISTORY CATECHOL SAO2 EXPCO2 ARTCO2 VENTALV VENTLUNG VENITUBE DISCONNECT MINVOLSET VENTMACH KINKEDTUBE INTUBATION PULMEMBOLUS PAP SHUNT ANAPHYLAXIS MINOVL PVSAT FIO2 PRESS INSUFFANESTH TPR LVFAILURE ERRBLOWOUTPUT STROEVOLUME LVEDVOLUME HYPOVOLEMIA CVP BP Mainly based on F. V. Jensen, „Bayesian Networks and Decision Graphs“, Springer-Verlag New York Advanced I WS 06/07 Junction Tree

Graphical Models - Inference -

  • Upload
    marina

  • View
    26

  • Download
    0

Embed Size (px)

DESCRIPTION

MINVOLSET. KINKEDTUBE. PULMEMBOLUS. INTUBATION. VENTMACH. DISCONNECT. PAP. SHUNT. VENTLUNG. VENITUBE. PRESS. MINOVL. FIO2. VENTALV. PVSAT. ANAPHYLAXIS. ARTCO2. EXPCO2. SAO2. TPR. INSUFFANESTH. HYPOVOLEMIA. LVFAILURE. CATECHOL. LVEDVOLUME. STROEVOLUME. ERRCAUTER. HR. - PowerPoint PPT Presentation

Citation preview

Page 1: Graphical Models - Inference -

Graphical Models- Inference -

Graphical Models- Inference -

Wolfram Burgard, Luc De Raedt, Kristian Kersting, Bernhard Nebel

Albert-Ludwigs University Freiburg, Germany

PCWP CO

HRBP

HREKG HRSAT

ERRCAUTERHRHISTORY

CATECHOL

SAO2 EXPCO2

ARTCO2

VENTALV

VENTLUNG VENITUBE

DISCONNECT

MINVOLSET

VENTMACHKINKEDTUBEINTUBATIONPULMEMBOLUS

PAP SHUNT

ANAPHYLAXIS

MINOVL

PVSAT

FIO2PRESS

INSUFFANESTHTPR

LVFAILURE

ERRBLOWOUTPUTSTROEVOLUMELVEDVOLUME

HYPOVOLEMIA

CVP

BP

Mainly based on F. V. Jensen, „Bayesian Networks and Decision Graphs“, Springer-Verlag New York, 2001.

AdvancedI WS 06/07

Junction Tree

Page 2: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Outline

• Introduction • Reminder: Probability theory• Basics of Bayesian Networks• Modeling Bayesian networks• Inference (VE, Junction tree)• Excourse: Markov Networks• Learning Bayesian networks• Relational Models

Page 3: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Why Junction trees ?

• Multiple inference, e.g.,

• For each i do variable elimination?

No, instead reuse information resp.

computations

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 4: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

A potential A over a set of variables A is a function that maps each configuration into a non-negative real number.

domA=A (domain of A )

Potentials

Examples: Conditional probability distribution and joint probability distributions are special cases of potentials

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 5: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Ex: A potential A,B,C over the set of variables {A,B,C}. A has four states, and B and C has three states. domA,B,C ={A,B,C}

Potentials

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 6: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Let be a set of potentials (e.g. CPDs), and let X

be a variable. X is eliminated from

1. Remove all potentials in with X in the domain. Let X that set.

2. Calculate

3. Add to

4. Iterate

VE using Potentials

Potential where X is not amember of the domain

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 7: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Domain Graph

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

moral link

Let nbe potentials over UmwithdomiDi. The domain graph for is the undirected graphwith variables of U as nodes and with a link between pairs of variables being members of the same Di.

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 8: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Moralizing

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 9: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Moralizing

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

- Inference (Junction Tree)

- Inference (Junction Tree)

CPDs

Page 10: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Moralizing

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

- Inference (Junction Tree)

- Inference (Junction Tree)

CPDs

CPD=

potential

Page 11: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Moralizing

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

- Inference (Junction Tree)

- Inference (Junction Tree)

CPDs

CPD=

potential

Potentials induceundirected edges

Page 12: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Moralizing

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Domain Graph(Moral Graph)

- Inference (Junction Tree)

- Inference (Junction Tree)

CPDs

CPD=

potential

moral link

Potentials induceundirected edges

Page 13: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Elimination Sequence

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Moral Graph

A1

A4

A2

A5 A6

Elim

inat

ing

A3

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 14: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Elimination Sequence

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Moral Graph

A1

A4

A2

A5 A6

Elim

inat

ing

A3

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 15: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Reminder: Markov Networks

• Undirected Graphs• Nodes = random variables• Cliques = potentials (~ local jpd)

VE on potentials

works

for Markov netw

orks

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 16: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Elimination Sequence

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

Bayesian Network

Moralizing

Moral Graph

A1

A4

A2

A5 A6

fill-ins: work with a potential over a domain that was not present originally

Elim

inat

ing

A3

GOAL:Elimination sequence that does not introduce fill-ins

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 17: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A6

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 18: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A6 A5

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 19: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A6 A5A1

A3

A4

A2

A3

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 20: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A1

A4

A2

A6 A5A1

A3

A4

A2

A3 A1

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 21: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A1

A4

A2A4

A2

A6 A5

A2

A1

A3

A4

A2

A3 A1

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 22: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A1

A4

A2A4

A2

A4

A6 A5

A2

A1

A3

A4

A2

A3 A1

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 23: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Perfect Elimination Sequence ...

A1

A3

A4

A2

A5 A6

... do not introduce fill-ins

A1

A3

A4

A2

A5

A1

A4

A2A4

A2

A4

A6 A5

A2

A1

A3

A4

A2

A3 A1There are several perfectelimination sequencesending in A4But they have different

complexities

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 24: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

• Characterized by the set of domains

• Set of domains of potentials produced during

the elimination (potentials that are subsets of

other potentials are removed).

• A6,A5,A3,A1,A2,A4: {{A6,A3},{A2,A3,A5},

{A1,A2,A3},{A1,A2},{A2,A4}}

Complexity of Elimination Sequence

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 25: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Complexity of Elimination Sequence

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5

A1

A4

A2A4

A2

A4

A6 A5

A2

A1

A3

A4

A2

A3 A1

- Inference (Junction Tree)

- Inference (Junction Tree)

{A3,A6} {A2,A3,A5} {A1,A2,A3}

{A1,A2} {A2,A4}

Page 26: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

• All perfect elimination sequences produce the same domain set, namely the set of cliques of the domain

• Any perfect elimination sequence ending with A is optimal with respect to computing P(A)

Complexity of Elimination Sequence

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 27: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Triangulated Graphs and Join Trees

• An undirected graph with complete elimination sequence is called a triangulated graph

A1

A3

A4

A2

A5

A1

A3

A4

A2

A5

triangulated nontriangulated

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 28: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Triangulated Graphs and Join Trees

A1

A3

A4

A2

A5

Neighbours of A5

A1

A3

A4

A2

A5

Family of A5

• Complete neighbour set = simplicial node• X is simplicial iff family of X is a clique

A1

A3

A4

A2

A5

Family of A3, i.e. A3 is simplicial

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 29: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Let G be a triangulated graph,

and let X be a simplicial node.

Let G´be the graph resulting from eliminating X from G. Then G´is a triangulated

graph

A1

A3

A4

A2

A5

X

Eliminatin

g X

A1

A3

A4

A2

A5

Triangulated Graphs and Join Trees

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 30: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Triangulated Graphs and Join Trees

• A triangulated graph with at least two nodes has at least two simplicial nodes

• In a triangulated graph, each variable A has a perfect elimination sequence ending with A

• Not all domain graphs are triangulated: An undirected graph is triangulated iff all nodes can be eliminated by successively eliminating a simplicial node

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 31: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Join Trees

Let G be the set of cliques from

an undirected graph, and let the cliques of G be organized

in a tree. • T is a join tree if for any

pair of nodes V, W all nodes on the path between V an W contain the intersection VW

BCDE

ABCD DEFI

BCDG

CHGJ

BCDE

ABCD DEFI

BCDG

CHGJ

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 32: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Join Trees

Let G be the set of cliques from

an undirected graph, and let the cliques of G be organized

in a tree. • T is a join tree if for any

pair of nodes V, W all nodes on the path between V an W contain the intersection VW

BCDE

ABCD DEFI

BCDG

CHGJ

BCDE

ABCD DEFI

BCDG

CHGJ

join tree

not a join tree

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 33: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Join Trees

• If the cliques of an undirected graph G can be organized into a join tree, then G is triangulated

• If the undirected graph is triangulated, then the cliques of G can be organizes into a join tree

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 34: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Triangulated, undirected Graph -> Join trees

A E

F

I

D

J

GH

B

C

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X is number according to the number of nodes eliminated

• Denote the set of remaining nodes Si

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 35: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Triangulated, undirected Graph -> Join trees

A E

F

I

D

J

GH

B

C

X

ABCDV1

BCDS1 separator

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X a number i according to the number of nodes eliminated

• Denote the set of remaining nodes Si

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 36: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X a number i according to the number of nodes eliminated

• Denote the set of remaining nodes Si

Triangulated, undirected Graph -> Join trees

A E

F

I

D

J

GH

B

C

X

ABCDV1

BCDS1 separator

A{A,B,C,D}

{B,C,D}

1

S1

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 37: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Triangulated, undirected Graph -> Join trees

E

F

I

D

J

GH

B

C

ABCDV1

BCDS1

X

DEFIV3

DES3

X

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X is number according to the number of nodes eliminated

• Denote the set of remaining nodes Si

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 38: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X is number according to the number of nodes eliminated

• Denote the set of remaining nodes Si

Triangulated, undirected Graph -> Join trees

E

F

I

D

J

GH

B

C

ABCDV1

BCDS1

X

DEFIV3

DES3

X

{D,E,F,I}

E

{D,E}

3

S3

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 39: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Triangulated, undirected Graph -> Join trees

ABCDV1

BCDS1

DEFIV3

DES3

CGHJV5

CGS5

BCDGV6

BCDS6

BCDEV10

• Simplicial node X• Family of X is a clique• Eliminate nodes from

family of X which have only neighbours in the family of X

• Give family of X is number according to the number of nodes eliminated

• Denote the set of remaining nodes Si

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 40: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Triangulated, undirected Graph -> Join trees

• Connect each separator Si to a clique Vj, j>i, such that Si is a subset of Vj

ABCDV1

BCDS1

DEFIV3

DES3

CGHJV5

CGS5

BCDGV6

BCDS6

BCDEV10

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 41: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Join Tree

ABCDV1

BCDS1

DEFIV3

DES3

CGHJV5

CGS5

BCDGV6

BCDS6

BCDEV10

- Inference (Junction Tree)

- Inference (Junction Tree)

The potential representation of a join tree (aka clique tree) is the product of the clique potentials, dived by the product of the separator potentials.

Page 42: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Yet Another Example

A1

A3

A4

A2

A5 A6

A1

A3

A4

A2

A5 A6

A3,A6V1

A3S1

A2,A3,A5V2

A2,A3S2

A2,A4V6

A2S4

A1,A2,A3V4

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 43: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Junction Trees

• Let be a set of potentials with a triangulated domain graph. A junction tree for is join tree for G with– Each potential in is

associated to a clique containing dom(

– Each link has separator attached containing two mailboxes, one for each direction

A1

A3

A4

A2

A5 A6

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 44: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Propagation on a Junction Tree

• Node V can send exactly one message to a neighbour W, and it may only be sent when V has received a message from all of its other neighbours

• Choose one clique (arbitrarily) as a root of the tree; collect message to this node and then distribute messages away from it.

• After collection and distribution phases, we have all we need in each clique to compute potential for variables.

- Inference (Junction Tree)

- Inference (Junction Tree)

Page 45: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Junction Trees - Collect Evidence

- Inference (Junction Tree)

- Inference (Junction Tree)

• P(A4) ?• Find clique containing

A4• V6 temporary root• Send messages from leaves to root• V4 assembles the

incoming messages, potential

Page 46: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

• Propagation/message passing between two adjacent cliques C1, C2 (S0 is their seperator)

– Marginalize C1’s potential to get new potential for S0

– Update C2’s potential

– Update S0’s potential to its new potential

Junction Tree - Messages

∑=01

1

\

*

SC

CSoφφ

0

022

**

S

SCC φ

φφφ =

Page 47: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Junction Trees - Collect Evidence

- Inference (Junction Tree)

- Inference (Junction Tree)

• P(A4) ?• Find clique containing

A4• V6 temporary root• Send messages from leaves to root• V4 assembles the

incoming messages, potential

Page 48: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Junction Trees - Collect Evidence

- Inference (Junction Tree)

- Inference (Junction Tree)

• P(A4) ?

• All marginals?

Page 49: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07

Junction Trees - Distribute Evidence

- Inference (Junction Tree)

- Inference (Junction Tree)

• All marginals?

Page 50: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Nontriangulated Domain Graphs

• Embed domain graph in a traingulated graph• Use ist junction tree• Simple idea:

– Eliminate variables in some order– If you wish to eliminate a node with non-

complete neighbour set, make it complete by adding fill-ins

A

E

F

I

D

J

G

H

B C A

E

F

I

D

J

G

H

B C

A,C,H,I,J,B,G,D,E,F- Inference (Junction Tree)

- Inference (Junction Tree)

Page 51: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Summary JTA

• Convert Bayesian network into JT

• Initialize potentials and separators

• Incorporate Evidence (set potentials accordingly)

• Collect and distribute evidence

• Obtain clique marginals by marginalization/normalization

- Inference (Junction Tree)

- Inference (Junction Tree)

Image fromCecil Huang

Page 52: Graphical Models - Inference -

Bayesian Networks

Bayesian Networks

AdvancedI WS 06/07 Inference Engines

• (Commercial) HUGIN : http://www.hugin.com

• (Commercial) NETICA: http://www.norsys.com

• Bayesian Network Toolbox for Matlab www.cs.ubc.ca/~murphyk/Software/BNT/bnt.html

• GENIE/SMILE (JAVA) http://www2.sis.pitt.edu/~genie/

• MSBNx, Microsoft, http://research.microsoft.com/adapt/MSBNx/

• Profile Toolbox http://www.informatik.uni-freiburg.de/~kersting/profile/

- Inference (Junction Tree)

- Inference (Junction Tree)