Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lirong Xia Speech recognition, machine learning Friday, April 4, 2014.

Similar presentations

Presentation on theme: "Lirong Xia Speech recognition, machine learning Friday, April 4, 2014."— Presentation transcript:

1 Lirong Xia Speech recognition, machine learning Friday, April 4, 2014

2 Particle Filtering 1 Sometimes |X| is too big to use exact inference –|X| may be too big to even store B(X) –E.g. X is continuous –|X| 2 may be too big to do updates Solution: approximate inference –Track samples of X, not all values –Samples are called particles –Time per step is linear in the number of samples –But: number needed may be large –In memory: list of particles This is how robot localization works in practice

3 Elapse of time B’(X t )= Σ x t-1 p(X t |x t-1 )B(x t-1 ) Observe B(X t ) ∝ p(e t |X t )B’(X t ) Renormalize B(x t ) sum up to 1 2 Forward algorithm vs. particle filtering Forward algorithm Particle filtering Elapse of time x--->x’ Observe w(x’)=p(e t |x) Resample resample N particles

4 Dynamic Bayes Nets (DBNs) 3 We want to track multiple variables over time, using multiple sources of evidence Idea: repeat a fixed Bayes net structure at each time Variables from time t can condition on those from t-1 DBNs with evidence at leaves are HMMs

5 HMMs: MLE Queries 4 HMMs defined by: –States X –Observations E –Initial distribution: p(X 1 ) –Transitions: p(X|X -1 ) –Emissions: p(E|X) Query: most likely explanation:

6 Viterbi Algorithm 5

7 Today 6 Speech recognition –A massive HMM! –Details of this section not required –CSCI 4962: Natural language processing by Prof. Heng Ji Start to learn machine learning –CSCI 4100: machine learning by Prof. Malik Magdon- Ismail

8 Speech and Language 7 Speech technologies –Automatic speech recognition (ASR) –Text-to-speech synthesis (TTS) –Dialog systems Language processing technologies –Machine translation –Information extraction –Web search, question answering –Text classification, spam filtering, etc…

9 Digitizing Speech 8

10 The Input 9 Speech input is an acoustic wave form Graphs from Simon Arnfield’s web tutorial on speech, sheffield:

11 10

12 The Input 11 Frequency gives pitch; amplitude gives volume –Sampling at ~8 kHz phone, ~16 kHz mic Fourier transform of wave displayed as a spectrogram –Darkness indicates energy at each frequency

13 Acoustic Feature Sequence 12 Time slices are translated into acoustic feature vectors (~39 real numbers per slice) These are the observations, now we need the hidden states X

14 State Space 13 p(E|X) encodes which acoustic vectors are appropriate for each phoneme (each kind of sound) p(X|X’) encodes how sounds can be strung together We will have one state for each sound in each word From some state x, can only: –Stay in the same state (e.g. speaking slowly) –Move to the next position in the word –At the end of the word, move to the start of the next word We build a little state graph for each word and chain them together to form our state space X

15 HMMs for Speech 14

16 Transitions with Bigrams 15

17 Decoding 16 While there are some practical issues, finding the words given the acoustics is an HMM inference problem We want to know which state sequence x 1:T is most likely given the evidence e 1:T : From the sequence x, we can simply read off the words

18 Machine Learning 17 Up until now: how to reason in a model and how make optimal decisions Machine learning: how to acquire a model on the basis of data / experience –Learning parameters (e.g. probabilities) –Learning structure (e.g. BN graphs) –Learning hidden concepts (e.g. clustering)

19 Parameter Estimation 18 Estimating the distribution of a random variable Elicitation: ask a human (why is this hard?) Empirically: use training data (learning!) –E.g.: for each outcome x, look at the empirical rate of that value: –This is the estimate that maximizes the likelihood of the data

20 Estimation: Smoothing 19 Relative frequencies are the maximum likelihood estimates (MLEs) In Bayesian statistics, we think of the parameters as just another random variable, with its own distribution ????

21 Estimation: Laplace Smoothing 20 Laplace’s estimate: –Pretend you saw every outcome once more than you actually did –Can derive this as a MAP estimate with Dirichlet priors

22 Estimation: Laplace Smoothing 21 Laplace’s estimate (extended): –Pretend you saw every outcome k extra times –What’s Laplace with k=0? –k is the strength of the prior Laplace for conditionals: –Smooth each condition independently:

23 Example: Spam Filter 22 Input: Output: spam/ham Setup: –Get a large collection of example s, each labeled “spam” or “ham” –Note: someone has to hand label all this data! –Want to learn to predict labels of new, future s Features: the attributes used to make the ham / spam decision –Words: FREE! –Text patterns: $dd, CAPS –Non-text: senderInContacts –……

24 Example: Digit Recognition 23 Input: images / pixel grids Output: a digit 0-9 Setup: –Get a large collection of example images, each labeled with a digit –Note: someone has to hand label all this data! –Want to learn to predict labels of new, future digit images Features: the attributes used to make the digit decision –Pixels: (6,8) = ON –Shape patterns: NumComponents, AspectRation, NumLoops –……

25 A Digit Recognizer 24 Input: pixel grids Output: a digit 0-9

26 Naive Bayes for Digits 25 Simple version: –One feature F ij for each grid position –Possible feature values are on / off, based on whether intensity is more or less than 0.5 in underlying image –Each input maps to a feature vector, e.g. –Here: lots of features, each is binary valued Naive Bayes model: What do we need to learn?

27 General Naive Bayes 26 A general naive Bayes model: We only specify how each feature depends on the class Total number of parameters is linear in n

28 Inference for Naive Bayes 27 Goal: compute posterior over causes –Step 1: get joint probability of causes and evidence –Step 2: get probability of evidence –Step 3: renormalize

29 General Naive Bayes 28 What do we need in order to use naive Bayes? –Inference (you know this part) Start with a bunch of conditionals, p(Y) and the p(F i |Y) tables Use standard inference to compute p(Y|F 1 …F n ) Nothing new here –Estimates of local conditional probability tables p(Y), the prior over labels p(F i |Y) for each feature (evidence variable) These probabilities are collectively called the parameters of the model and denoted by θ Up until now, we assumed these appeared by magic, but… … they typically come from training data: we’ll look at this now

30 Examples: CPTs

31 Important Concepts 30 Data: labeled instances, e.g. s marked spam/ham –Training set –Held out set –Test set Features: attribute-value pairs which characterize each x Experimentation cycle –Learn parameters (e.g. model probabilities) on training set –(Tune hyperparameters on held-out set) –Compute accuracy of test set –Very important: never “peek” at the test set! Evaluation –Accuracy: fraction of instances predicted correctly Overfitting and generalization –Want a classifier which does well on test data –Overfitting: fitting the training data very closely, but not generalizing well –We’ll investigate overfitting and generalization formally in a few lectures

Download ppt "Lirong Xia Speech recognition, machine learning Friday, April 4, 2014."

Similar presentations

Ads by Google