SlideShare a Scribd company logo
1 of 124
Download to read offline
PRML 13.2.2

The forward-backward
algorithm	
 
August 4, 2014
by Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Quick review	

HMM is trained by EM algorithm	

	

E-step: 	

Evaluate γ(zn) and ξ(zn-1, zn)	

	

M-step:	

Update parameters	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
γ(z1k)
K
j=1 γ(z1j)
,
Ajk =
N
n=2 ξ(zn−1, j, znk)
K
l=1
N
n=2 ξ(zn−1, j, znl)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Quick review	

HMM is trained by EM algorithm	

	

E-step: 	

Evaluate γ(zn) and ξ(zn-1, zn)	

	

M-step:	

Update parameters	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
γ(z1k)
K
j=1 γ(z1j)
,
Ajk =
N
n=2 ξ(zn−1, j, znk)
K
l=1
N
n=2 ξ(zn−1, j, znl)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

? ?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
How to calculate γ(zn), ξ(zn-1, zn) ?	

	

Basic idea is message passing on tree	

	

(It will be studied later, and we shall do
conventional style now)	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+1 zNzn-1 znz1
xn+1 xNxn-1 xnx1
Head Tail
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of γ(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) = p(zn|x1:N)
=
p(x1:N|zn)p(zn)
p(x1:N)
=
p(x1:n|zn)p(zn)p(xn+1:N|zn)
p(x1:N)
β(zn)	
 α(zn)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

? ?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
?
?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Now problem is changed into	

	

How to calculate α(zn), β(zn) ?	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn-1 znz1
xn-1 xnx1
Head
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn-1 znz1
xn-1 xnx1
Head
Tail
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(x1:n|zn)p(zn)
= p(xn|zn)p(x1:n−1|zn)p(zn)
= p(xn|zn)p(x1:n−1, zn)
= p(xn|zn)
zn−1
p(x1:n−1, zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1)
= p(xn|zn)
zn−1
α(zn−1)A.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(xn|zn)
zn−1
α(zn−1)A.
k = 1
k = 2
k = K
...
n = 1 n = 2 n = N...
O(K)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(xn|zn)
zn−1
α(zn−1)A.
k = 1
k = 2
k = K
...
n = 1 n = 2 n = N...
O(K2
)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(xn|zn)
zn−1
α(zn−1)A.
k = 1
k = 2
k = K
...
n = 1 n = 2 n = N...
O(K2
N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

	

Start of recursion?	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(z1) = p(x1|z1)p(z1) =


π1 p(x1|φ1)
...
πN p(x1|φN)


.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of α(zn) 	

	

Start of recursion?	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(z1) = p(x1|z1)p(z1) =


π1 p(x1|φ1)
...
πN p(x1|φN)


.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
?
?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+2 zNzn zn+1
xn+2 xNxn xn+1
Head
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+2 zNzn zn+1
xn+2 xNxn xn+1
Tail
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) = p(xn+1:N|zn)
=
zn+1
p(xn+1:N|zn, zn+1)p(zn+1|zn)
=
zn+1
p(xn+1:N|zn+1)p(zn+1|zn)
=
zn+1
p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn)
=
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
β(zn) =
zn+1
β(zn+1)p(xn+1|zn+1)AT
.
k = 1
k = 2
k = K
...
n = 1 n = 2 n = N...
O(K2
N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

Start of recursion?	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(zN|x1:N) =
p(x1:N|zN)p(zN)β(zN)
p(x1:N)
⇔ β(zN) = 1 · · · 1
T
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of β(zn) 	

	

Start of recursion?	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(zN|x1:N) =
p(x1:N|zN)p(zN)β(zN)
p(x1:N)
⇔ β(zN) = 1 · · · 1
T
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

It appears on the denominator of γ(zn).	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) =
α(zn)β(zn)
p(x1:N)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

It appears on the denominator of γ(zn).	

In fact, we don't need it for update because it
cancel out.	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
γ(z1k)
K
j=1 γ(z1j)
,
Ajk =
N
n=2 ξ(zn−1, j, znk)
K
l=1
N
n=2 ξ(zn−1, j, znl)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

It appears on the denominator of γ(zn).	

In fact, we don't need it for update because it
cancel out.	

	

However, we need to evaluate it,	

because it's LIKELIHOOD, which is monitored.	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) =
α(zn)β(zn)
p(X)
.
⇔
zn
γ(zn) =
zn
α(zn)β(zn)
p(X)
.
⇔ p(X) =
zn
α(zn)β(zn) ( γ = 1).
∴ p(X) =
zN
α(zN) =
k
αk(zN).
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) =
α(zn)β(zn)
p(X)
.
⇔
zn
γ(zn) =
zn
α(zn)β(zn)
p(X)
.
⇔ p(X) =
zn
α(zn)β(zn) ( γ = 1).
∴ p(X) =
zN
α(zN) =
k
αk(zN).
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) =
α(zn)β(zn)
p(X)
.
⇔
zn
γ(zn) =
zn
α(zn)β(zn)
p(X)
.
⇔ p(X) =
zn
α(zn)β(zn) ( γ = 1).
∴ p(X) =
zN
α(zN) =
k
αk(zN).Any n will do
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of p(x1:N) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(zn) =
α(zn)β(zn)
p(X)
.
⇔
zn
γ(zn) =
zn
α(zn)β(zn)
p(X)
.
⇔ p(X) =
zn
α(zn)β(zn) ( γ = 1).
∴ p(X) =
zN
α(zN) =
k
αk(zN).
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
p(x1:N) 	

?
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
p(x1:N) 	

Nth
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+1 zNzn-1 znz1
xn+1 xNxn-1 xnx1
Head
Tail
TailTail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+1 zNzn-1 znz1
xn+1 xNxn-1 xnx1
Head
Tail
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+1 zNzn-1 znz1
xn+1 xNxn-1 xnx1
Head
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn−1, zn) = p(zn−1, zn|x1:N)
=
p(x1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
...
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zn+1 zNzn-1 znz1
xn+1 xNxn-1 xnx1
Head
Tail
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
β(zn)	
 α(zn)
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Evaluation of ξ(zn-1, zn) 	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn)
p(x1:N)
=
p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1)
p(x1:N)
=
α(zn−1)p(xn|zn)p(zn|zn−1)β(zn)
p(x1:N)
.
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

?
p(x1:N) 	

Nth
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

p(x1:N) 	

Nth
The forward-backward algorithm	
 
E-step of EM algorithm for HMM
Summary	

HMM is trained by EM algorithm	

	

E-step: 	

Evaluate α(zn) and β(zn)	

	

	

	

	

	

M-step:	

Update parameters	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
α(zn) = p(xn|zn)
zn−1
α(zn−1)p(zn|zn−1),
β(zn) =
zn+1
β(zn+1)p(xn+1|zn+1)p(zn+1|zn).
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Multiple shorter sequences
In some practical situation, we can't get a
long sequence.	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Multiple shorter sequences
In some practical situation, we can't get a
long sequence.	

Instead, we get multiple shorter sequences.	

	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Multiple shorter sequences
In some practical situation, we can't get a
long sequence.	

Instead, we get multiple shorter sequences.	

	

	

In this situation, we are still able to use
forward-backward algorithm 	

(w/ bit modification).	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Multiple shorter sequences
E-step	

	

Just evaluate independently	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(z(r)
n ) = p(z(r)
n |X(r)
, θold
),
ξ(z(r)
n−1, z(r)
n ) = p(z(r)
n−1, z(r)
n |X(r)
, θold
).
The forward-backward algorithm	
 
Multiple shorter sequences
E-step	

	

Just evaluate independently	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
γ(z(r)
n ) = p(z(r)
n |X(r)
, θold
),
ξ(z(r)
n−1, z(r)
n ) = p(z(r)
n−1, z(r)
n |X(r)
, θold
).
The forward-backward algorithm	
 
Multiple shorter sequences
M-step	

	

Just add them all	

	

	

	

	

	

etc.	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
R
r=1 γ(z(r)
1k )
R
r=1
K
j=1 γ(z(r)
i j )
,
Ajk =
R
r=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nk )
R
r=1
K
l=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nl )
The forward-backward algorithm	
 
Multiple shorter sequences
M-step	

	

Just add them all	

	

	

	

	

	

etc.	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
R
r=1 γ(z(r)
1k )
R
r=1
K
j=1 γ(z(r)
i j )
,
Ajk =
R
r=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nk )
R
r=1
K
l=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nl )
The forward-backward algorithm	
 
Multiple shorter sequences
M-step	

	

Just add them all	

	

	

	

	

	

etc.	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
πk =
R
r=1 γ(z(r)
1k )
R
r=1
K
j=1 γ(z(r)
i j )
,
Ajk =
R
r=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nk )
R
r=1
K
l=1
Nr
n=2 ξ(z(r)
n−1, j, z(r)
nl )
Note: p(X) no
longer cancel out
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Predictive distribution
Once you trained the HMM, next thing you want
to do may be PREDICTION.	

I.e., evaluation of p(xN+1|X)	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zN zN+1z1
xN xN+1x1
Head
Tail
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
p(xN+1|X) =
zN+1
p(xN+1, zN+1|X)
=
zN+1
p(xN+1|zN+1, X)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)p(zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN, zN+1|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
...
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
zN zN+1z1
xN xN+1x1
Head
Tail
Tail
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
...
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN, X)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)p(zN|X)
=
zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)
p(zN, X)
p(X)
=
1
p(X) zN+1
p(xN+1|zN+1)
zN
p(zN+1|zN)α(zN).
Only depend on α(zN)
i.e., whole X don't need
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

β(zn) 	

 α(zn) 	

p(x1:N) 	

Nth
The forward-backward algorithm	
 
Predictive distribution
Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
ξ(zn-1, zn) 	

γ(zn) 	

p(x1:N) 	

β(zn) 	

 α(zn) 	

p(xN+1|X) 	

Nth	

Nth
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA
The forward-backward algorithm	
 
Today's topics	
 
The forward-backward algorithm	

1.  E-step of EM algorithm for HMM	

2.  Multiple shorter sequences 	

3.  Predictive distribution	

Aug 4, 2014
 PRML 13.2.2
 Shinichi TAMURA

More Related Content

What's hot

Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.mohanrathod18
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Edureka!
 
Artificial Intelligence 1 Planning In The Real World
Artificial Intelligence 1 Planning In The Real WorldArtificial Intelligence 1 Planning In The Real World
Artificial Intelligence 1 Planning In The Real Worldahmad bassiouny
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rulesswapnac12
 
Resolution,forward backward chaining
Resolution,forward backward chainingResolution,forward backward chaining
Resolution,forward backward chainingAnn Rose
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2DigiGurukul
 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptxPEzhumalai
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculusRajendran
 
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...Sebastian Raschka
 
Nonnegative Matrix Factorization
Nonnegative Matrix FactorizationNonnegative Matrix Factorization
Nonnegative Matrix FactorizationTatsuya Yokota
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic ReasoningJunya Tanaka
 

What's hot (20)

Hidden markov model ppt
Hidden markov model pptHidden markov model ppt
Hidden markov model ppt
 
GMM
GMMGMM
GMM
 
Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
 
Lecture10 - Naïve Bayes
Lecture10 - Naïve BayesLecture10 - Naïve Bayes
Lecture10 - Naïve Bayes
 
Artificial Intelligence 1 Planning In The Real World
Artificial Intelligence 1 Planning In The Real WorldArtificial Intelligence 1 Planning In The Real World
Artificial Intelligence 1 Planning In The Real World
 
Primitive Recursive Functions
Primitive Recursive FunctionsPrimitive Recursive Functions
Primitive Recursive Functions
 
Learning set of rules
Learning set of rulesLearning set of rules
Learning set of rules
 
Query trees
Query treesQuery trees
Query trees
 
Resolution,forward backward chaining
Resolution,forward backward chainingResolution,forward backward chaining
Resolution,forward backward chaining
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2
 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptx
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
Recurrent neural networks
Recurrent neural networksRecurrent neural networks
Recurrent neural networks
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Nonnegative Matrix Factorization
Nonnegative Matrix FactorizationNonnegative Matrix Factorization
Nonnegative Matrix Factorization
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic Reasoning
 

Viewers also liked

Time management working smarter
 Time management working smarter Time management working smarter
Time management working smartereileen sutton
 
An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)ananth
 
PRML 2.4-2.5: The Exponential Family & Nonparametric Methods
PRML 2.4-2.5: The Exponential Family & Nonparametric MethodsPRML 2.4-2.5: The Exponential Family & Nonparametric Methods
PRML 2.4-2.5: The Exponential Family & Nonparametric MethodsShinichi Tamura
 
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann Machines
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann MachinesESL 17.3.2-17.4: Graphical Lasso and Boltzmann Machines
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann MachinesShinichi Tamura
 
MLaPP 2章 「確率」(前編)
MLaPP 2章 「確率」(前編)MLaPP 2章 「確率」(前編)
MLaPP 2章 「確率」(前編)Shinichi Tamura
 
NIPS 2016 輪読: Supervised Word Movers Distance
NIPS 2016 輪読: Supervised Word Movers DistanceNIPS 2016 輪読: Supervised Word Movers Distance
NIPS 2016 輪読: Supervised Word Movers DistanceShinichi Tamura
 
PRML 9.1-9.2: K-means Clustering & Mixtures of Gaussians
PRML 9.1-9.2: K-means Clustering & Mixtures of GaussiansPRML 9.1-9.2: K-means Clustering & Mixtures of Gaussians
PRML 9.1-9.2: K-means Clustering & Mixtures of GaussiansShinichi Tamura
 
Use of Rasmol and study of proteins
Use of Rasmol and study of proteins Use of Rasmol and study of proteins
Use of Rasmol and study of proteins kamalmodi481
 
Gene expression introduction
Gene expression introductionGene expression introduction
Gene expression introductionSetia Pramana
 
Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Muhammad Ishaq
 
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating Hyperplane
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating HyperplaneESL 4.4.3-4.5: Logistic Reression (contd.) and Separating Hyperplane
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating HyperplaneShinichi Tamura
 
Immune response to hiv infection
Immune response to hiv infectionImmune response to hiv infection
Immune response to hiv infectionNarenkumar M
 
ISOLATION OF RNA
ISOLATION OF RNA ISOLATION OF RNA
ISOLATION OF RNA Suresh San
 
5 immune defense against bacterial pathogens
5 immune defense against bacterial  pathogens5 immune defense against bacterial  pathogens
5 immune defense against bacterial pathogensPrabesh Raj Jamkatel
 
Principles of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPrinciples of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPerez Eric
 

Viewers also liked (20)

Lect24 hmm
Lect24 hmmLect24 hmm
Lect24 hmm
 
Time management working smarter
 Time management working smarter Time management working smarter
Time management working smarter
 
An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)
 
PRML 2.4-2.5: The Exponential Family & Nonparametric Methods
PRML 2.4-2.5: The Exponential Family & Nonparametric MethodsPRML 2.4-2.5: The Exponential Family & Nonparametric Methods
PRML 2.4-2.5: The Exponential Family & Nonparametric Methods
 
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann Machines
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann MachinesESL 17.3.2-17.4: Graphical Lasso and Boltzmann Machines
ESL 17.3.2-17.4: Graphical Lasso and Boltzmann Machines
 
Ch09 combinatorialpatternmatching
Ch09 combinatorialpatternmatchingCh09 combinatorialpatternmatching
Ch09 combinatorialpatternmatching
 
MLaPP 2章 「確率」(前編)
MLaPP 2章 「確率」(前編)MLaPP 2章 「確率」(前編)
MLaPP 2章 「確率」(前編)
 
NIPS 2016 輪読: Supervised Word Movers Distance
NIPS 2016 輪読: Supervised Word Movers DistanceNIPS 2016 輪読: Supervised Word Movers Distance
NIPS 2016 輪読: Supervised Word Movers Distance
 
PRML 9.1-9.2: K-means Clustering & Mixtures of Gaussians
PRML 9.1-9.2: K-means Clustering & Mixtures of GaussiansPRML 9.1-9.2: K-means Clustering & Mixtures of Gaussians
PRML 9.1-9.2: K-means Clustering & Mixtures of Gaussians
 
Use of Rasmol and study of proteins
Use of Rasmol and study of proteins Use of Rasmol and study of proteins
Use of Rasmol and study of proteins
 
Gene expression introduction
Gene expression introductionGene expression introduction
Gene expression introduction
 
1. vectors
1. vectors1. vectors
1. vectors
 
Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...Artificial neural network model & hidden layers in multilayer artificial neur...
Artificial neural network model & hidden layers in multilayer artificial neur...
 
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating Hyperplane
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating HyperplaneESL 4.4.3-4.5: Logistic Reression (contd.) and Separating Hyperplane
ESL 4.4.3-4.5: Logistic Reression (contd.) and Separating Hyperplane
 
Immune response to viruses
Immune response to virusesImmune response to viruses
Immune response to viruses
 
Immune response to hiv infection
Immune response to hiv infectionImmune response to hiv infection
Immune response to hiv infection
 
ISOLATION OF RNA
ISOLATION OF RNA ISOLATION OF RNA
ISOLATION OF RNA
 
HIV/AIDS (IMMUNOLOGY)
HIV/AIDS (IMMUNOLOGY)HIV/AIDS (IMMUNOLOGY)
HIV/AIDS (IMMUNOLOGY)
 
5 immune defense against bacterial pathogens
5 immune defense against bacterial  pathogens5 immune defense against bacterial  pathogens
5 immune defense against bacterial pathogens
 
Principles of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMPPrinciples of DNA isolation, PCR and LAMP
Principles of DNA isolation, PCR and LAMP
 

Similar to PRML 13.2.2: The Forward-Backward Algorithm

PR 103: t-SNE
PR 103: t-SNEPR 103: t-SNE
PR 103: t-SNETaeoh Kim
 
Color Coding
Color CodingColor Coding
Color CodingASPAK2014
 
Generic Reinforcement Schemes and Their Optimization
Generic Reinforcement Schemes and Their OptimizationGeneric Reinforcement Schemes and Their Optimization
Generic Reinforcement Schemes and Their Optimizationinfopapers
 

Similar to PRML 13.2.2: The Forward-Backward Algorithm (6)

Detection & Estimation Theory
Detection & Estimation TheoryDetection & Estimation Theory
Detection & Estimation Theory
 
PR 103: t-SNE
PR 103: t-SNEPR 103: t-SNE
PR 103: t-SNE
 
Phase Unwrapping
Phase UnwrappingPhase Unwrapping
Phase Unwrapping
 
Color Coding
Color CodingColor Coding
Color Coding
 
Algorithm.ppt
Algorithm.pptAlgorithm.ppt
Algorithm.ppt
 
Generic Reinforcement Schemes and Their Optimization
Generic Reinforcement Schemes and Their OptimizationGeneric Reinforcement Schemes and Their Optimization
Generic Reinforcement Schemes and Their Optimization
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

PRML 13.2.2: The Forward-Backward Algorithm

  • 1. PRML 13.2.2 The forward-backward algorithm August 4, 2014 by Shinichi TAMURA
  • 2. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 3. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 4. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 5. The forward-backward algorithm E-step of EM algorithm for HMM Quick review HMM is trained by EM algorithm E-step: Evaluate γ(zn) and ξ(zn-1, zn) M-step: Update parameters Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = γ(z1k) K j=1 γ(z1j) , Ajk = N n=2 ξ(zn−1, j, znk) K l=1 N n=2 ξ(zn−1, j, znl) .
  • 6. The forward-backward algorithm E-step of EM algorithm for HMM Quick review HMM is trained by EM algorithm E-step: Evaluate γ(zn) and ξ(zn-1, zn) M-step: Update parameters Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = γ(z1k) K j=1 γ(z1j) , Ajk = N n=2 ξ(zn−1, j, znk) K l=1 N n=2 ξ(zn−1, j, znl) .
  • 7. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn)
  • 8. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) ? ?
  • 9. The forward-backward algorithm E-step of EM algorithm for HMM How to calculate γ(zn), ξ(zn-1, zn) ? Basic idea is message passing on tree (It will be studied later, and we shall do conventional style now) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 10. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N)
  • 11. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N)
  • 12. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N)
  • 13. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+1 zNzn-1 znz1 xn+1 xNxn-1 xnx1 Head Tail Tail
  • 14. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N)
  • 15. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N)
  • 16. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of γ(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = p(zn|x1:N) = p(x1:N|zn)p(zn) p(x1:N) = p(x1:n|zn)p(zn)p(xn+1:N|zn) p(x1:N) β(zn) α(zn)
  • 17. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) ? ?
  • 18. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? ? ? p(x1:N) ?
  • 19. The forward-backward algorithm E-step of EM algorithm for HMM Now problem is changed into How to calculate α(zn), β(zn) ? Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 20. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 21. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 22. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn-1 znz1 xn-1 xnx1 Head Tail
  • 23. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 24. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 25. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 26. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 27. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 28. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn-1 znz1 xn-1 xnx1 Head Tail Tail
  • 29. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 30. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 31. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 32. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(x1:n|zn)p(zn) = p(xn|zn)p(x1:n−1|zn)p(zn) = p(xn|zn)p(x1:n−1, zn) = p(xn|zn) zn−1 p(x1:n−1, zn|zn−1)p(zn−1) = p(xn|zn) zn−1 p(x1:n−1|zn−1)p(zn|zn−1)p(zn−1) = p(xn|zn) zn−1 α(zn−1)A.
  • 33. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(xn|zn) zn−1 α(zn−1)A. k = 1 k = 2 k = K ... n = 1 n = 2 n = N... O(K)
  • 34. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(xn|zn) zn−1 α(zn−1)A. k = 1 k = 2 k = K ... n = 1 n = 2 n = N... O(K2 )
  • 35. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(xn|zn) zn−1 α(zn−1)A. k = 1 k = 2 k = K ... n = 1 n = 2 n = N... O(K2 N)
  • 36. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Start of recursion? Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(z1) = p(x1|z1)p(z1) =   π1 p(x1|φ1) ... πN p(x1|φN)   .
  • 37. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of α(zn) Start of recursion? Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(z1) = p(x1|z1)p(z1) =   π1 p(x1|φ1) ... πN p(x1|φN)   .
  • 38. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? ? ? p(x1:N) ?
  • 39. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? ? p(x1:N) ?
  • 40. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 41. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 42. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 43. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+2 zNzn zn+1 xn+2 xNxn xn+1 Head Tail
  • 44. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 45. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 46. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 47. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+2 zNzn zn+1 xn+2 xNxn xn+1 Tail Tail
  • 48. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 49. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 50. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 51. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = p(xn+1:N|zn) = zn+1 p(xn+1:N|zn, zn+1)p(zn+1|zn) = zn+1 p(xn+1:N|zn+1)p(zn+1|zn) = zn+1 p(xn+2:N|zn+1)p(xn+1|zn+1)p(zn+1|zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT .
  • 52. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA β(zn) = zn+1 β(zn+1)p(xn+1|zn+1)AT . k = 1 k = 2 k = K ... n = 1 n = 2 n = N... O(K2 N)
  • 53. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Start of recursion? Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(zN|x1:N) = p(x1:N|zN)p(zN)β(zN) p(x1:N) ⇔ β(zN) = 1 · · · 1 T .
  • 54. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of β(zn) Start of recursion? Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(zN|x1:N) = p(x1:N|zN)p(zN)β(zN) p(x1:N) ⇔ β(zN) = 1 · · · 1 T .
  • 55. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? ? p(x1:N) ?
  • 56. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? p(x1:N) ?
  • 57. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) It appears on the denominator of γ(zn). Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = α(zn)β(zn) p(x1:N)
  • 58. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) It appears on the denominator of γ(zn). In fact, we don't need it for update because it cancel out. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = γ(z1k) K j=1 γ(z1j) , Ajk = N n=2 ξ(zn−1, j, znk) K l=1 N n=2 ξ(zn−1, j, znl) .
  • 59. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) It appears on the denominator of γ(zn). In fact, we don't need it for update because it cancel out. However, we need to evaluate it, because it's LIKELIHOOD, which is monitored. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 60. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = α(zn)β(zn) p(X) . ⇔ zn γ(zn) = zn α(zn)β(zn) p(X) . ⇔ p(X) = zn α(zn)β(zn) ( γ = 1). ∴ p(X) = zN α(zN) = k αk(zN).
  • 61. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = α(zn)β(zn) p(X) . ⇔ zn γ(zn) = zn α(zn)β(zn) p(X) . ⇔ p(X) = zn α(zn)β(zn) ( γ = 1). ∴ p(X) = zN α(zN) = k αk(zN).
  • 62. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = α(zn)β(zn) p(X) . ⇔ zn γ(zn) = zn α(zn)β(zn) p(X) . ⇔ p(X) = zn α(zn)β(zn) ( γ = 1). ∴ p(X) = zN α(zN) = k αk(zN).Any n will do
  • 63. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of p(x1:N) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(zn) = α(zn)β(zn) p(X) . ⇔ zn γ(zn) = zn α(zn)β(zn) p(X) . ⇔ p(X) = zn α(zn)β(zn) ( γ = 1). ∴ p(X) = zN α(zN) = k αk(zN).
  • 64. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? p(x1:N) ?
  • 65. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? p(x1:N) Nth
  • 66. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 67. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 68. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 69. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+1 zNzn-1 znz1 xn+1 xNxn-1 xnx1 Head Tail TailTail
  • 70. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 71. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 72. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 73. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+1 zNzn-1 znz1 xn+1 xNxn-1 xnx1 Head Tail Tail
  • 74. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 75. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 76. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 77. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+1 zNzn-1 znz1 xn+1 xNxn-1 xnx1 Head Tail
  • 78. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 79. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 80. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn−1, zn) = p(zn−1, zn|x1:N) = p(x1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1, zn)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn−1, zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) ...
  • 81. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) .
  • 82. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) .
  • 83. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zn+1 zNzn-1 znz1 xn+1 xNxn-1 xnx1 Head Tail
  • 84. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) .
  • 85. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) .
  • 86. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) . β(zn) α(zn)
  • 87. The forward-backward algorithm E-step of EM algorithm for HMM Evaluation of ξ(zn-1, zn) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn−1, zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn−1, zn) p(x1:N) = p(x1:n−1|zn−1)p(xn|zn)p(xn+1:N|zn)p(zn|zn−1)p(zn−1) p(x1:N) = α(zn−1)p(xn|zn)p(zn|zn−1)β(zn) p(x1:N) .
  • 88. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) ? p(x1:N) Nth
  • 89. The forward-backward algorithm E-step of EM algorithm for HMM Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) p(x1:N) Nth
  • 90. The forward-backward algorithm E-step of EM algorithm for HMM Summary HMM is trained by EM algorithm E-step: Evaluate α(zn) and β(zn) M-step: Update parameters Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA α(zn) = p(xn|zn) zn−1 α(zn−1)p(zn|zn−1), β(zn) = zn+1 β(zn+1)p(xn+1|zn+1)p(zn+1|zn).
  • 91. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 92. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 93. The forward-backward algorithm Multiple shorter sequences In some practical situation, we can't get a long sequence. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 94. The forward-backward algorithm Multiple shorter sequences In some practical situation, we can't get a long sequence. Instead, we get multiple shorter sequences. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 95. The forward-backward algorithm Multiple shorter sequences In some practical situation, we can't get a long sequence. Instead, we get multiple shorter sequences. In this situation, we are still able to use forward-backward algorithm (w/ bit modification). Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 96. The forward-backward algorithm Multiple shorter sequences E-step Just evaluate independently Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(z(r) n ) = p(z(r) n |X(r) , θold ), ξ(z(r) n−1, z(r) n ) = p(z(r) n−1, z(r) n |X(r) , θold ).
  • 97. The forward-backward algorithm Multiple shorter sequences E-step Just evaluate independently Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA γ(z(r) n ) = p(z(r) n |X(r) , θold ), ξ(z(r) n−1, z(r) n ) = p(z(r) n−1, z(r) n |X(r) , θold ).
  • 98. The forward-backward algorithm Multiple shorter sequences M-step Just add them all etc. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = R r=1 γ(z(r) 1k ) R r=1 K j=1 γ(z(r) i j ) , Ajk = R r=1 Nr n=2 ξ(z(r) n−1, j, z(r) nk ) R r=1 K l=1 Nr n=2 ξ(z(r) n−1, j, z(r) nl )
  • 99. The forward-backward algorithm Multiple shorter sequences M-step Just add them all etc. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = R r=1 γ(z(r) 1k ) R r=1 K j=1 γ(z(r) i j ) , Ajk = R r=1 Nr n=2 ξ(z(r) n−1, j, z(r) nk ) R r=1 K l=1 Nr n=2 ξ(z(r) n−1, j, z(r) nl )
  • 100. The forward-backward algorithm Multiple shorter sequences M-step Just add them all etc. Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA πk = R r=1 γ(z(r) 1k ) R r=1 K j=1 γ(z(r) i j ) , Ajk = R r=1 Nr n=2 ξ(z(r) n−1, j, z(r) nk ) R r=1 K l=1 Nr n=2 ξ(z(r) n−1, j, z(r) nl ) Note: p(X) no longer cancel out
  • 101. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 102. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 103. The forward-backward algorithm Predictive distribution Once you trained the HMM, next thing you want to do may be PREDICTION. I.e., evaluation of p(xN+1|X) Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 104. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 105. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 106. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 107. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zN zN+1z1 xN xN+1x1 Head Tail
  • 108. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 109. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 110. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 111. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA p(xN+1|X) = zN+1 p(xN+1, zN+1|X) = zN+1 p(xN+1|zN+1, X)p(zN+1|X) = zN+1 p(xN+1|zN+1)p(zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN, zN+1|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) ...
  • 112. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 113. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 114. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA zN zN+1z1 xN xN+1x1 Head Tail Tail
  • 115. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 116. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 117. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 118. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN).
  • 119. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ... = zN+1 p(xN+1|zN+1) zN p(zN+1|zN, X)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN)p(zN|X) = zN+1 p(xN+1|zN+1) zN p(zN+1|zN) p(zN, X) p(X) = 1 p(X) zN+1 p(xN+1|zN+1) zN p(zN+1|zN)α(zN). Only depend on α(zN) i.e., whole X don't need
  • 120. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) β(zn) α(zn) p(x1:N) Nth
  • 121. The forward-backward algorithm Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA ξ(zn-1, zn) γ(zn) p(x1:N) β(zn) α(zn) p(xN+1|X) Nth Nth
  • 122. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 123. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA
  • 124. The forward-backward algorithm Today's topics The forward-backward algorithm 1.  E-step of EM algorithm for HMM 2.  Multiple shorter sequences 3.  Predictive distribution Aug 4, 2014 PRML 13.2.2 Shinichi TAMURA