740 likes | 852 Views
Fast Temporal State-Splitting for HMM Model Selection and Learning. Sajid Siddiqi Geoffrey Gordon Andrew Moore. x. t. x. t. How many kinds of observations (x) ?. x. t. How many kinds of observations (x) ? 3. x. t. How many kinds of observations (x) ? 3
E N D
Fast Temporal State-Splittingfor HMM Model Selection and Learning Sajid Siddiqi Geoffrey Gordon Andrew Moore
x t
x t How many kinds of observations (x) ?
x t How many kinds of observations (x) ? 3
x t How many kinds of observations (x) ? 3 How many kinds of transitions (xt+1|xt)?
x t How many kinds of observations (x) ? 3 How many kinds of transitions (xt+1|xt)? 4
x t We say that this sequence ‘exhibits four states under the first-order Markov assumption’ Our goal is to discover the number of such states (and their parameter settings) in sequential data, and to do so efficiently How many kinds of observations (x) ? 3 How many kinds of transitions ( xtxt+1)? 4
Definitions An HMM is a 3-tuple = {A,B,π}, where A : NxN transition matrix B :NxM observation probability matrix π : Nx1 prior probability vector || : number of states in HMM , i.e. N T : number of observations in sequence qt: the state the HMM is in at time t
O0 q0 q1 q2 q3 q4 O1 O2 1/3 O3 O4 HMMs as DBNs
q0 q1 q2 q3 q4 Notation: Transition Model 1/3 Each of these probability tables is identical
q0 q1 q2 q3 q4 Observation Model O0 O1 O2 O3 Notation: O4
HMMs as DBNs O0 q0 q1 q2 q3 q4 O1 O2 1/3 O3 O4
HMMs as DBNs O0 q0 q1 q2 q3 q4 O1 O2 1/3 O3 O4 HMMs as FSAs S2 S1 S3 S4
Operations on HMMs Problem 1: Evaluation Given an HMM and an observation sequence, what is the likelihood of this sequence? Problem 2: Most Probable Path Given an HMM and an observation sequence, what is the most probable path through state space? Problem 3: Learning HMM parameters Given an observation sequence and a fixed number of states, what is an HMM that is likely to have produced this string of observations? Problem 3: Learning the number of states Given an observation sequence, what is an HMM (of any size) that is likely to have produced this string of observations?
Path Inference • Viterbi Algorithm for calculating argmaxQ P(O,Q|)
Path Inference • Viterbi Algorithm for calculating argmaxQ P(O,Q|) Running time: O(TN2) Yields a globally optimal path through hidden state space, associating each timestep with exactly one HMM state.
Parameter Learning I • Viterbi Training(≈ K-means for sequences)
Parameter Learning I • Viterbi Training(≈ K-means for sequences) Q*s+1 = argmaxQP(O,Q|s) (Viterbi algorithm) s+1 = argmaxP(O,Q*s+1|) Running time: O(TN2) per iteration Models the posterior belief as a δ-function per timestep in the sequence. Performs well on data with easily distinguishable states.
Parameter Learning II • Baum-Welch(≈ GMM for sequences) • Iterate the following two steps until • Calculate the expected complete log-likelihood given s • Obtain updated model parameters s+1by maximizing this log-likelihood
Parameter Learning II • Baum-Welch(≈ GMM for sequences) • Iterate the following two steps until • Calculate the expected complete log-likelihood given s • Obtain updated model parameters s+1by maximizing this log-likelihood Obj(,s)=EQ[P(O,Q|) | O,s] s+1 = argmaxObj(,s) Running time: O(TN2) per iteration, but with a larger constant Models the full posterior belief over hidden states per timestep. Effectively models sequences with overlapping states at the cost of extra computation.
HMM Model Selection • Distinction between model search and actual selection step • We can search the spaces of HMMs with different N using parameter learning, and perform selection using a criterion like BIC.
HMM Model Selection • Distinction between model search and actual selection step • We can search the spaces of HMMs with different N using parameter learning, and perform selection using a criterion like BIC. Running time: O(Tn2) to compute likelihood for BIC
HMM Model Selection I • for n = 1 … Nmax • Initialize n-state HMM randomly • Learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop
HMM Model Selection I • for n = 1 … Nmax • Initialize n-state HMM randomly • Learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop Running time: O(Tn2) per iteration Drawback: Local minima in parameter optimization
HMM Model Selection II • for n = 1 … Nmax • for i = 1 … NumTries • Initialize n-state HMM randomly • Learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop
HMM Model Selection II • for n = 1 … Nmax • for i = 1 … NumTries • Initialize n-state HMM randomly • Learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop Running time: O(NumTries x Tn2) per iteration Evaluates NumTries candidate models for each n to overcome local minima. However: expensive, and still prone to local minima especially for large N
Idea: Binary state splits* to generate candidate models • To split state s into s1and s2, • Create ’ such that ’\s \s • Initialize ’s1 and ’s2 based on s and on parameter constraints Notation:s : HMM parameters related to state s\s : HMM parameters not related to state s * first proposed in Ostendorf and Singer, 1997
Idea: Binary state splits* to generate candidate models • To split state s into s1and s2, • Create ’ such that ’\s \s • Initialize ’s1 and ’s2 based on s and on parameter constraints • This is an effective heuristic for avoiding local minima Notation:s : HMM parameters related to state s\s : HMM parameters not related to state s * first proposed in Ostendorf and Singer, 1997
Overall algorithm Start with a small number of states EM (B.W. or V.T.) Binary state splits* followed by EM BIC on training set Stop when bigger HMMis not selected
Overall algorithm Start with a small number of states EM (B.W. or V.T.) Binary state splitsfollowed by EM BIC on training set Stop when bigger HMMis not selected What is ‘efficient’? Want this loop to be at most O(TN2)
HMM Model Selection III • Initialize n0-state HMM randomly • for n = n0 … Nmax • Learn model parameters • for i = 1 … n • Split state i, learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop
HMM Model Selection III • Initialize n0-state HMM randomly • for n = n0 … Nmax • Learn model parameters • for i = 1 … n • Split state i, learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop O(Tn2)
HMM Model Selection III • Initialize n0-state HMM randomly • for n = n0 … Nmax • Learn model parameters • for i = 1 … n • Split state i, learn model parameters • Calculate BIC score • If best so far, store model • if larger model not chosen, stop O(Tn2) Running time: O(Tn3) per iteration of outer loop More effective at avoiding local minima than previous approaches. However, scales poorly because of n3 term.
Fast Candidate Generation Only consider timesteps owned by s in Viterbi path Only allow parameters of split states to vary Merge parameters and store as candidate
OptimizeSplitParams I: Split-State Viterbi Training (SSVT) Iterate until convergence:
Constrained Viterbi Splitting state s to s1,s2. We calculate using a fast ‘constrained’ Viterbi algorithm over only those timesteps owned by s in Q*, and constraining them to belong to s1or s2 .
The Viterbi path is denoted by Suppose we split state N into s1,s2
The Viterbi path is denoted by Suppose we split state N into s1,s2 ? ? ? ? ? ? ? ?
The Viterbi path is denoted by Suppose we split state N into s1,s2
The Viterbi path is denoted by Suppose we split state N into s1,s2
OptimizeSplitParams I: Split-State Viterbi Training (SSVT) Iterate until convergence: Running time: O(|Ts|n) per iteration When splitting state s, assumes rest of the HMM parameters (\s ) and rest of the Viterbi path (Q*\Ts) are both fixed
Fast approximate BIC Compute once for base model: O(Tn2) Update optimistically* for candidate model: O(|Ts|) * first proposed in Stolcke and Omohundro, 1994
HMM Model Selection IV • Initialize n0-state HMM randomly • for n = n0 … Nmax • Learn model parameters • for i = 1 … n • Split state i, optimize by constrained EM • Calculate approximate BIC score • If best so far, store model • if larger model not chosen, stop
HMM Model Selection IV • Initialize n0-state HMM randomly • for n = n0 … Nmax • Learn model parameters • for i = 1 … n • Split state i, optimize by constrained EM • Calculate approximate BIC score • If best so far, store model • if larger model not chosen, stop O(Tn) Running time: O(Tn2) per iteration of outer loop!