26
Accelerating Viterbi Algorithm 20120814 Pei-Ching Li

Accelerating Viterbi Algorithm

  • Upload
    kaiya

  • View
    92

  • Download
    0

Embed Size (px)

DESCRIPTION

Accelerating Viterbi Algorithm. 20120814 Pei- Ching Li. Outline. Introduction of Viterbi Algorithm Example Architecture Parallel on CUDA MIDI hmmtrain Future Works. Introduction of Viterbi Algorithm. - PowerPoint PPT Presentation

Citation preview

Page 1: Accelerating  Viterbi  Algorithm

Accelerating Viterbi Algorithm

20120814Pei-Ching Li

Page 2: Accelerating  Viterbi  Algorithm

Outline

• Introduction of Viterbi Algorithm– Example

• Architecture– Parallel on CUDA

• MIDI– hmmtrain

• Future Works

Page 3: Accelerating  Viterbi  Algorithm

Introduction of Viterbi Algorithm

• a dynamic programming algorithm for finding the most likely sequence of hidden states called the Viterbi path.

• HiddenMarkovModel

Page 4: Accelerating  Viterbi  Algorithm

Example O = Walk->Walk->Shop->Clean

Page 5: Accelerating  Viterbi  Algorithm

Example O = Walk->Walk->Shop->Clean

Page 6: Accelerating  Viterbi  Algorithm

Example O = Walk->Walk->Shop->Clean

Page 7: Accelerating  Viterbi  Algorithm

Example O = Walk->Walk->Shop->Clean

Page 8: Accelerating  Viterbi  Algorithm

ExampleO = Walk->Walk->Shop->CleanS = Sunny->Sunny->Rainy->Rainy

Page 9: Accelerating  Viterbi  Algorithm

Parallel Part

• CSE551 Final Project: Parallel Viterbi on a GPU– Authors: Seong Jae Lee, Miro Enev– Provenance: Autumm 2009,

University of Washington

Page 10: Accelerating  Viterbi  Algorithm

Architecture

• Input– transition probability– emission probability

• Algorithm– hmmgenerate– hmmviterbi– accuracy of hmmviterbi

Page 11: Accelerating  Viterbi  Algorithm

Matlab 2011

• [SEQ, STATES] = HMMGENERATE(LEN,TRANSITIONS,EMISSIONS)

• STATES = HMMVITERBI(SEQ,TRANSITIONS,EMISSIONS)

• Use MATLAB Coder to generate C/C++ code

Page 12: Accelerating  Viterbi  Algorithm

Parallel on CUDA

• Focus on hmmviterbi() to accelerate– Calculate the values– Choose the maximum• reduction

Page 13: Accelerating  Viterbi  Algorithm

Parallel on CUDA (2nd version)

Page 14: Accelerating  Viterbi  Algorithm

Parallel on CUDA

Page 15: Accelerating  Viterbi  Algorithm

MIDI

• Score : • Length : 1 second• Hmmtrain : – unknown states– initial guesses for TRANS

and EMIS– hmmtrain (seq, TRANS_GUESS, EMIS_GUESS)

Page 16: Accelerating  Viterbi  Algorithm

hmmtrain (seq, TRANS_GUESS, EMIS_GUESS)

• TRANS_GUESS : 12x12– C → D, D → E, E → F, F → G 0.8– Others random

• EMIS_GUESS : played or not– 0.9 vs. 0.1– Not accepted

Page 17: Accelerating  Viterbi  Algorithm

hmmtrain (seq, TRANS_GUESS, EMIS_GUESS)

• seq– Source– Output of band-pass filter

• Hmmtrain will use algo.– BaumWelch : hmmdecode• Calculates the posterior state probabilities of a

sequence of emissions– Viterbi : hmmviterbi

Page 18: Accelerating  Viterbi  Algorithm

hmmtrain

• The results of models have big difference than the guess!

• Can’t use the results to get the great states when running Viterbi algorithm.

Page 19: Accelerating  Viterbi  Algorithm

Future Works

• Finish the 3rd version.• Modify the guess models to get the better

result!

Page 20: Accelerating  Viterbi  Algorithm

THANK YOU

Page 21: Accelerating  Viterbi  Algorithm

Appendix 1 : O(nm2)

• n stands for the number of observations• m is the number of possible states of an

observation

Page 22: Accelerating  Viterbi  Algorithm

Appendix 2 : Reference

• CSE551 Final Project: Parallel Viterbi on a GPU– Authors: Seong Jae Lee, Miro Enev– Provenance: Autumm 2009,

University of Washington

Page 23: Accelerating  Viterbi  Algorithm

Appendix 2 : CSE551 Final Project : Parallel Viterbi on a GPU

Page 24: Accelerating  Viterbi  Algorithm

Appendix 2 : CSE551 Final Project : Parallel Viterbi on a GPU

Page 25: Accelerating  Viterbi  Algorithm

Appendix 3 : Auto-generated Probability Models

• Random + constraint– tmp = (float)rand() / (float)RAND_MAX;– prob = (tmp <= constraint) ? 0 : tmp;

• Guarantee probability of each row equals 1.

• Verify the sequence conformed to the models.– hmmestimate(seq, states)

Page 26: Accelerating  Viterbi  Algorithm

Appendix 3 : Auto-generated Probability Models

• Viterbi algorithm– when back tracing the likely states, avoid to save

the 0 state• (rand() % N) + 1