CSE 473: Ar+ficial Intelligence: Bayes' Nets
CSE 473: Ar+ficial Intelligence: Bayes' Nets
CSE 473: Ar+ficial Intelligence: Bayes' Nets
Bayes Nets
Daniel
Weld
[Most
slides
were
created
by
Dan
Klein
and
Pieter
Abbeel
for
CS188
Intro
to
AI
at
UC
Berkeley.
All
CS188
materials
are
available
at
hNp://ai.berkeley.edu.]
Condi+onal
Independences
Dynamics
dont
change
X1
X2
X3
X4
XN5
E1
E2
E3
E4
EN5
Example
HMM
Computa+ons
Given
parameters
evidence E1:n =e1:n
Inference problems include:
Filtering, find P(Xt|e1:t) for all t
Smoothing, find P(Xt|e1:n) for all t
Most probable explanation, find
x*1:n = argmaxx1:n P(x1:n|e1:n)
Passage of Time
X1
X1
X2
E1
P(x)
Distribution
Par+cles:
(3,3)
(2,3)
(3,3)
(3,2)
(3,3)
(3,2)
(1,2)
(3,3)
(3,3)
(2,3)
Par+cles:
(3,3)
(2,3)
(3,3)
(3,2)
(3,3)
(3,2)
(1,2)
(3,3)
(3,3)
(2,3)
Weight
Par+cles:
(3,2)
(2,3)
(3,2)
(3,1)
(3,3)
(3,2)
(1,3)
(2,3)
(3,2)
(2,2)
Resample
Par+cles:
(3,2)
w=.9
(2,3)
w=.2
(3,2)
w=.9
(3,1)
w=.4
(3,3)
w=.4
(3,2)
w=.9
(1,3)
w=.1
(2,3)
w=.2
(3,2)
w=.9
(2,2)
w=.4
(New)
Par+cles:
(3,2)
(2,2)
(3,2)
(2,3)
(3,3)
(3,2)
(1,3)
(2,3)
(3,2)
(3,2)
Which
Algorithm?
Particle filter, uniform initial beliefs, 25 particles
Which
Algorithm?
Particle filter, uniform initial beliefs, 300 particles
Which
Algorithm?
Exact filter, uniform initial beliefs
13
Q
R
0.1
0.05
0.2
0.07
0.03
F
http://img4.wikia.nocookie.net/__cb20090430175407/monster/images/9/92/Basilisk.jpg
0.05 0.1
0.3
15
I am a BIG joint
distribution!
harrypotter.wikia.com/
Means:
Or, equivalently:
16
X1
X2
X3
X4
E1
E1
E3
E4
X2
X3
E1
E1
E3
X4
E4
X3
E3
X3
t =2
G1a
E1a
G3a
G2a
G1b
E1b
t =3
G3b
G2b
E2a
E2b
E3a
E3b
10
Probabilis+c
Models
Models
describe
how
(a
por+on
of)
the
world
works
Models
are
always
simplica+ons
May
not
account
for
every
variable
May
not
account
for
all
interac+ons
between
variables
All
models
are
wrong;
but
some
are
useful.
George
E.
P.
Box
11
Independence
Independence
Two
variables
are
independent
if:
This
says
that
their
joint
distribu+on
factors
into
a
product
two
simpler
distribu+ons
Another form:
We write:
12
Example: Independence?
hot
0.5
cold
0.5
hot
sun
0.4
hot
rain
0.1
cold
sun
0.2
cold
rain
0.3
W
sun
0.6
rain
0.4
hot
sun
0.3
hot
rain
0.2
cold
sun
0.3
cold
rain
0.2
Example:
Independence
N
fair,
independent
coin
ips:
H
0.5
0.5
0.5
0.5
0.5
0.5
13
Condi+onal
Independence
P(Toothache,
Cavity,
Catch)
If
I
have
a
cavity,
the
probability
that
the
probe
catches
in
it
doesn't
depend
on
whether
I
have
a
toothache:
P(+catch
|
+toothache,
+cavity)
=
P(+catch
|
+cavity)
Equivalent statements:
Condi+onal
Independence
Uncondi+onal
(absolute)
independence
very
rare
(why?)
Condi)onal
independence
is
our
most
basic
and
robust
form
of
knowledge
about
uncertain
environments.
X
is
condi+onally
independent
of
Y
given
Z
if
and
only
if:
or,
equivalently,
if
and
only
if
14
Condi+onal
Independence
What
about
this
domain:
Trac
Umbrella
Raining
15
P(T,B,G)
+t
+b
+g
0.16
+t
+b
-g
0.16
+t
-b
+g
0.24
+t
-b
-g
0.04
-t
+b
+g
0.04
-t
+b
-g
0.24
-t
-b
+g
0.06
-t
-b
-g
0.06
Number of Parameters?
16
17
Arcs: interac+ons
18
X1
X2
Xn
Example:
Trac
Variables:
R:
It
rains
T:
There
is
trac
Model 1: independence
Model
2:
rain
causes
trac
19
Example:
Trac
II
Lets
build
a
causal
graphical
model!
Variables
T:
Trac
R:
It
rains
L:
Low
pressure
D:
Roof
drips
B:
Ballgame
C:
Cavity
L
B
R
D
T
B:
Burglary
A:
Alarm
goes
o
M:
Mary
calls
J:
John
calls
E:
Earthquake!
B
E
A
20
P(A1 ) .
A1
P(An )
An
21
Probabili+es
in
BNs
Bayes
nets
implicitly
encode
joint
distribu+ons
As
a
product
of
local
condi+onal
distribu+ons
To
see
what
probability
a
BN
gives
to
a
full
assignment,
mul+ply
all
the
relevant
condi+onals
together:
Example:
Probabili+es
in
BNs
Why
are
we
guaranteed
that
seng
22
X2
Xn
0.5
0.5
0.5
0.5
0.5
0.5
Example: Trac
+r
T
-r
+r
1/4
-r
3/4
+t
3/4
-t
1/4
+t
1/2
-t
1/2
23
P(B)
Burglary
+b
0.001
-b
Earthqk
P(E)
+e
0.002
-e
0.999
0.998
Alarm
John
calls
A
Mary
calls
P(J|A)
P(A|B,E)
+b
+e
+a
0.95
+b
+e
-a
0.05
+b
-e
+a
0.94
P(M|A)
+b
-e
-a
0.06
+e
+a
0.29
+a
+j
0.9
+a
+m
0.7
-b
+a
-j
0.1
+a
-m
0.3
-b
+e
-a
0.71
-a
+j
0.05
-a
+m
0.01
-b
-e
+a
0.001
-a
-j
0.95
-a
-m
0.99
-b
-e
-a
0.999
Example:
Trac
Causal
direc+on
+r
T
-r
+r
1/4
-r
3/4
+t
3/4
-t
1/4
+t
1/2
-t
1/2
+r
+t
3/16
+r
-t
1/16
-r
+t
6/16
-r
-t
6/16
24
+t
9/16
-t
7/16
+r
+t
R
-t
+r
1/3
-r
2/3
+r
1/7
-r
6/7
+t
3/16
+r
-t
1/16
-r
+t
6/16
-r
-t
6/16
Causality?
When
Bayes
nets
reect
the
true
causal
paNerns:
Oen
simpler
(nodes
have
fewer
parents)
Oen
easier
to
think
about
Oen
easier
to
elicit
from
experts
25
Bayes
Nets
So
far:
how
a
Bayes
net
encodes
a
joint
distribu+on
Next:
how
to
answer
queries
about
that
distribu+on
Today:
26