# Weve dened a recursive way to compute the max

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: is as a x x marginal, the “max marginal” of the form pm (¯) = max p(¯, q ) x x (5.18) q m Given this, we can view the αq (t) as the max marginals up to time t m αq (t) = pm (x1:t , Qt = q ) (5.19) so that the above ﬁnal maximization makes sense. We’ve deﬁned a recursive way to compute the max marginal. From EE512: dynamic programming works on any commutative semi-ring, we’re just deﬁning the α recursion using the max-product semi-ring rather than the previous sum-product semi-ring. Prof. Jeﬀ Bilmes EE596A/Winter 2013/DGMs – Lecture 5 - Jan 25th, 2013 page 5-42 (of 232) HMMs Trellis Other HMM queries MPE Sampling What HMMs can do Summary Scratch MPE - Viterbi Path But this computes only the value, how to get the actual states? Will need to do a forward-backward pass, like α, β . argmax also distributes in a fashion. The true max at time t will depend on what the true max at time t + 1 is. We can pre-compute the max for all q at time t when going forward, and then when going backwards, once we know the true max at time t + 1, we backtrack and then used the previously computed max at time t. Repeating this from T back to 1 we’ve got the MPE. Prof. Jeﬀ Bilmes EE596A/Winter 2013/DGMs – Lecture 5 - Jan 25th, 2013 page 5-43 (of 232) HMMs Trellis Other HMM queries MPE Sampling What HMMs can do Summary Scratch MPE - Viterbi Path Computation argmax p(¯1:T , q1:T ) = argmax x q1:T ∈DQ1:T q1:T ∈DQ1:T t p(¯t |qt )p(qt |qt−1 ) x = argmax p(xT |qT ) . . . argmax p(¯2 |q2 )p(q3 |q2 ) argmax p(¯1 |q1 )p(q2 |q1 ) x x qT q2 q1 = argmax p(xT |qT ) . . . p(x3 |q3 ) argmax p(q3 |q2 ) p(¯2 |q2 ) argmax p(q2 |q1 ) (p(¯1 |q1 )) x x qT q2 q1 So inner most argmax depends on true max for q2 . Next inner-most argmax depends on q3 , and so on. We deﬁne a recursion that stores these integer state indices based on max marginal. m αq (t) ∈ argmax p(Qt = q |Qt−1 = r)αr (t − 1) ˇm (5.20) r Note that this is integer index, not a score. Prof. Jeﬀ Bilmes EE596A/Winter 2013/DGMs – Lecture 5 - Jan 25th, 2013 page 5-44 (of 232) HMMs Trellis Other HMM queries MPE Sampling What HMMs can do Summary Scratch MPE We can then compute Viterbi path by backtracking, which is entirely a deterministic process using index lookup (except for the initial case where we ﬁnd the maximum state). 1 2 3 m ∗ Compute qT ∈ argmaxq αq (T ) for t = T . . . 2 do ∗ Set qt−1 ← αq∗ (t) ˇm t Prof. Jeﬀ Bilmes EE596A/Winter 2013/DGMs – Lecture 5 - Jan 25th, 2013 page 5-45 (of 232) HMMs Trellis Other HMM queries MPE Sampling What HMMs can do Summary Scratch MPE - summary Forward Equations m αq (t) m αq (1) = p(¯1 |Q1 = q ) x = p(¯t |Qt = q ) max p(Qt = q |Qt−1 = x r (5.21) m r)αr (t − 1) (5.22) And the forward equation for storing the back indices: m αq (t) ∈ argmax p(Qt = q |Qt−1 = r)αr (t − 1) ˇm (5.23) r Backward algorithm, to compute the Viterbi path 1 2 3 m ∗ Compute qT ∈ argmaxq αq (T ) for t = T . . . 2 do ∗ Set qt−1 ← αq∗ (t) ˇm t Prof. Jeﬀ Bilmes EE596A/Winter...
View Full Document

## This document was uploaded on 04/05/2014.

Ask a homework question - tutors are online