layout: true --- # Sequence Learning ## Cost and States Korbinian Riedhammer --- # Today's Menu ### Better auto-correct using custom cost functions ### From edit distance to DTW with feature data ### From pair-wise DTW to state-based decoding --- # Better Auto-Correct ![qwerty](/sequence-learning/02-cost-and-states/qwerty.png) [source: wiki](https://commons.wikimedia.org/wiki/File:KB_United_States.svg#/media/File:KB_United_States.svg) - Compute cost of substitution by proximity of keys - Map keys to grid, compute euclidean distance - What about for example `g <> h`, or `a <> l`? Outlook: [Damerau-Levenshtein](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Distance_with_adjacent_transpositions) with adjacent transpositions. --- # DTW with Feature Data Edit distance between two waveforms? .left[
reference ] .right[ test utterance
] --- # DTW with Feature Data - Raw sample data way to numerous - Compute spectral (cepstral) features, eg. [MFCC](https://en.wikipedia.org/wiki/Mel-frequency_cepstrum) - Use euclidean distance on feature vectors - Uniform cost for substitution/deletion/insertion ## Isolated Word Recognition - Have prototype recordings for each word - Compute "distance" between test recoding and prototype words - Choose for word with least difference --- # Decoding States with DP ![dtmf1](/sequence-learning/02-cost-and-states/dtmf1.png) --- # Decoding States with DP ![dtmf2](/sequence-learning/02-cost-and-states/dtmf2.png) --- # Decoding States with DP - Don't compare to _individual class prototypes_ - Compare to _class prototypes_ - Since we relaxed the time constraint on the prototype axis, you must compute the minimum for all state transitions.