交接報告 7/3 - 語音處理實驗室

AI and Robotics

Oct 19, 2013 (4 years and 7 months ago)

138 views

ANN Tutorial

NTU Speech Lab

:

:

Speech Recognition

Acoustic Model

Language Model

Classifier

How do we build
this machine?

Machine Learning

“Field of study that gives computers the ability to
learn without being explicitly programmed”

Instead of writing a program by hand for each specific task, we
collect lots of examples that specify the correct output for a given
input.

A machine learning algorithm then takes these examples and
produces a program that does the job.

The program produced by the learning algorithm may look very
different from a typical hand
-
written program. It may contain
millions of numbers.

If we do it right, the program works for new cases as well as the
ones we trained it on.

If the data changes the program can change too by training on the
new data.

Massive amounts of computation are now cheaper than paying
-
specific program.

Reference:

Neural

Networks

for

Machine

Learning

course

by

Geoffrey

Hinton,

Coursera

Classifier

Male

Female

Others

Classifier

Features

Classes

Hair Length

Make
-
up

.

.

.

2D Feature Space

Hair Length

Make
-
Up

Female

Male

Voice pitch

Multi
-
D Feature Space

We need some type of non
-
linear function!

Neurons

Each neuron receives inputs from other neurons

The effect of each input line on the neuron is controlled by a synaptic weight

The weights can be positive or negative.

The synaptic weights

so that the whole network learns to perform
useful computations

Recognizing objects, understanding language, making plans, controlling
the body.

Reference:

Neural

Networks

for

Machine

Learning

course

by

Geoffrey

Hinton,

Coursera

Artificial Neural Network

A lot of simple non
-
linearity

complex non
-
linearity

output

bias

index over

input connections

i

input

th

i

th

weight
on

input

activation
function

w
4

y

x
4

x
3

x
2

x
1

w
3

w
2

w
1

1

b

Feed Forward Net

Activation Function

Sigmoid Function A.K.A Logistic Function

How Do Neural Nets Learn?

Intuition:

2. Compare the outputs of the net
to the targets

3. Try to adjust the weights to
match the outputs with the targets

1

4

-
3

0.2

0.9

0

1

t
j

Target

w

y
j

Reference:

Machine

Learning

course

by

Andrew Ng,

Coursera

Learning rate

Updated weights

w
1

w
2

Error

w
4

x
4

x
3

x
2

x
1

w
3

w
2

w
1

Back Propagation

Reference:

Neural

Networks

for

Machine

Learning

course

by

Geoffrey

Hinton,

Coursera

y
i

z
j

y
j

j

i

Overfitting

Which model do you
trust?

The complicated model fits the data
better.

But it is not
economical.

A model is convincing when it fits a lot
of data surprisingly well
.

Not just the training data.

Which output value should you
predict for this test input?

i
nput = x

o
utput = y

Reference:

Neural

Networks

for

Machine

Learning

course

by

Geoffrey

Hinton,

Coursera

Training and Testing

Divide dataset into training set and
validation set

Use training set for training, validation
set as indicator to
overfitting

Use another independent testing test to
performance

Speech Recognition

Acoustic Model

Language Model

Example
---

Inputs

MFCC:13 Dim Vector

We can ‘splice’ the right
and left 4 MFCCs to form
a 13 x 9 = 117 Dim Vector

Example
---

Output

Right context dependent initial final phones

‘a’, ‘
ai
’, ‘an’, ‘
ang
’, ‘au’, ‘
b_a
’, ‘
b_e
’, ‘
b_ee
’, ‘
b_i
’ …

117

Dim

MFCC

‘a’

ai

‘an’

0

1

Target

0

Matlab

NN toolkit
---
Net

net =
newff
(Feature,Label,10);

% given Feature and Label, this command generates an NN
with 10 hidden units

net =
newff
(
Feature,Label
,[20 10],{'
logsig
' '
tansig
'});

% this command generates an NN with two layers, one with 20

units and sigmoid as activation function, one with 10

units and
tanh

as activation function

Matlab

NN Toolkit
---
Train

[
net,tr
] = train(
net,Feature,Label
);

% this command will train the network, dividing your
dataset into training, validation, and testing set

Matlab

NN Toolkit
---
Test

out =
sim
(
net,testInputs
);

% this command runs the command you have trained on a
test data set to obtain outputs

Matlab

NN Toolkit
---
NNTool

nntool

% this command calls a GUI for NN visualization

Demo Program

Location: speech.ee.ntu.edu.tw/~
poetek
/
nnkit

Copy the folder to your computer, and run the file ‘
run.m

for a quick demo

DEMO

Demo Program
---

Results

Example (1): Classify the inputs into 4 classes: {‘a’, ‘e’, ‘
i
’, ‘u’}

ans

=

correct: 1139 out of 1205

accuracy =

0.9452

classification =

214 3 0 3

13 195 9 6

0 5 377 12

1 11 3 353

Demo Program
---

Results(2)

Example (2): Classify the inputs into 6 classes: {‘a’, ‘e’, ‘
i
’, ‘u’, ‘
b_a
’, ‘
p_a
’, ‘
m_a
’, ‘
f_a
’}

correct: 1293 out of 1446

accuracy =

0.8942

classification =

207 7 0 0 0 0 0 0

5 204 8 16 1 0 0 0

2 9 397 8 0 0 0 2

2 10 2 348 0 0 0 0

3 1 1 1 63 0 0 14

0 0 0 2 5 0 0 4

2 5 2 6 4 0 0 0

8 5 2 5 11 0 0 74

Demo Program
---

Results(3)

Example (3): Classify the inputs into all 147 classes

correct: 92 out of 506

accuracy =

0.1818

Assignments

Please run example 1~3 with the demo program, record

Please play around with different settings to achieve
better accuracy

Some parameters you can change:

Net structure

Training algorithm

Input Features

net.trainParam

‘help
newff

References

Neural

Networks

for

Machine

Learning

course

by

Geoffrey

Hinton,

Coursera

Machine

Learning

course

by

Andrew Ng,

Coursera

Matlab

NN toolkit documentation

Thank You!