From: John on
Hi all,

I was wondering if you could help me? I'm trying to train a neural network on some speech data (from the T146 corpus) where each input pattern is a 77x69 matrix (so 77 input neurons are needed) and each output is a 10x1 vector which indicates the corresponding output (for example if a spoken zero is presented the output will be

ans =

1
-1
-1
-1
-1
-1
-1
-1
-1
-1)

I can't work out how to present this to a neural network, I realise I need 77 input neurons and 10 output neurons, but what is the best way to present this to the network? Any help would be really appreciated.

Many thanks,

John
From: Greg Heath on
On Jun 15, 5:35 am, "John " <re...(a)epsam.keele.ac.uk> wrote:
> Hi all,
>
> I was wondering if you could help me?  I'm trying to train a neural network on some speech data (from the T146 corpus) where each input pattern is a 77x69 matrix (so 77 input neurons are needed) and each output is a 10x1 vector which indicates the corresponding output (for example if a spoken zero is presented the output will be
>
> ans =
>
>      1
>     -1
>     -1
>     -1
>     -1
>     -1
>     -1
>     -1
>     -1
>     -1)
>
> I can't work out how to present this to a neural network, I realise I need 77 input neurons and 10 output neurons, but what is the best way to present this to the network?  Any help would be really appreciated.
>
> Many thanks,
>
> John

If you have N observations of I-dimensional input vectors
and corresponding O-dimensional output vectors, the sizes
of the training data input and target matrices are

size(p) = [I N]
size(t) = [O N]

These can be used to train a FF MLP with node topology
I-H-O.

Hope this helps.

Greg
From: John on
Hi Greg - thanks for the reply. I have changed the output matrix to have the same number of columns as the input matrix. So I have two matrices I present to an Elman network which are the following size:

>> size(train_inp)
ans =
77 34107
>> size(train_out)
ans =
10 34107
When I present these to the network and try and train it using the following code:lrn_net = newelm(train_inp, train_out, 10);
lrn_net.trainFcn = 'traingdx';
lrn_net.performFcn = 'mse';
lrn_net.trainParam.show = 10;
lrn_net.trainParam.epochs = 300;

lrn_net = train(lrn_net, train_inp, train_out);

I get the following error:

??? Error using ==> network.train at 145
Inputs are incorrectly sized for network.
Matrix must have 153 rows.

Error in ==> elman_speech at 35
lrn_net = train(lrn_net, train_inp, train_out);

I really am struggling to see how to solve this, do I have the input and output matrices set up correctly?

Many thanks again,

John

Greg Heath <heath(a)alumni.brown.edu> wrote in message <60232189-d02e-48ef-bdfe-965ef0da043f(a)18g2000vbh.googlegroups.com>...
> On Jun 15, 5:35 am, "John " <re...(a)epsam.keele.ac.uk> wrote:
> > Hi all,
> >
> > I was wondering if you could help me?  I'm trying to train a neural network on some speech data (from the T146 corpus) where each input pattern is a 77x69 matrix (so 77 input neurons are needed) and each output is a 10x1 vector which indicates the corresponding output (for example if a spoken zero is presented the output will be
> >
> > ans =
> >
> >      1
> >     -1
> >     -1
> >     -1
> >     -1
> >     -1
> >     -1
> >     -1
> >     -1
> >     -1)
> >
> > I can't work out how to present this to a neural network, I realise I need 77 input neurons and 10 output neurons, but what is the best way to present this to the network?  Any help would be really appreciated.
> >
> > Many thanks,
> >
> > John
>
> If you have N observations of I-dimensional input vectors
> and corresponding O-dimensional output vectors, the sizes
> of the training data input and target matrices are
>
> size(p) = [I N]
> size(t) = [O N]
>
> These can be used to train a FF MLP with node topology
> I-H-O.
>
> Hope this helps.
>
> Greg
From: Greg Heath on
On Jun 20, 11:36 am, "John " <re...(a)epsam.keele.ac.uk> wrote:

PLEASE DO NOT CONTINUE TO COMMIT THE HEINOUS SIN OF TOP-POSTING!

> Hi Greg - thanks for the reply.  I have changed the output matrix to have the same number of columns as the input matrix.  So I have two matrices I present to an Elman network which are the following size:
>
> >> size(train_inp)
>
> ans =
>           77       34107

I thought you had 77X69 images. In that case I = 77*69 = 5313
which requires some low pass filtering to reduce the number of
pixels.


>> size(train_out)
>
> ans =
>           10       34107
> When I present these to the network and try and train it using the following code:lrn_net = newelm(train_inp, train_out, 10);
> lrn_net.trainFcn = 'traingdx';
> lrn_net.performFcn = 'mse';
> lrn_net.trainParam.show = 10;
> lrn_net.trainParam.epochs = 300;
>
> lrn_net = train(lrn_net, train_inp, train_out);  
>
> I get the following error:
>
> ??? Error using ==> network.train at 145
> Inputs are incorrectly sized for network.
> Matrix must have 153 rows.

I don't see the error. However, it may help
to realize that 2*77 = 154.

Until the program runs, it always helps to
use as many default inputs as possible.

Hope this helps.

Greg