Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Correctly ordering my inputs (Matlab Neural Network)

3 views
Skip to first unread message

Philip O'Brien

unread,
Nov 12, 2009, 8:21:42 AM11/12/09
to
Hi everyone, this is my first post after trawling the archives. I am
implementing a feed-forward backprop network with the aim of correctly
classifying a set of data into one of 4 distinct solutions, i.e. there
are four distinct inputs (different samples of each one also) and
consequently there are four distinct outputs. I have read a lot of
background information but I feel stuck in the doldrums at the moment.
I would like to check a few things :

Ordering of data
Training Matrix
| C C.. C ... C C.. C |
| A A.. A ... A A.. A |
| S S... S ... S S... S |
| E E... E ... E E... E |
| 1 1... 1 ... 4 4... 4 |
P= | S S... S ... S S... S |
| A A... A . .. A A... A |
| M M...M ... M M...M |
| P P... P ... P P... P |
| L L... L ... L L... L |
| E E... E ... E E... E |
| 1 2... 10 ... 1 2... 10 |


Target matrix
| C C.. C ... C C.. C |
| A A.. A ... A A.. A |
| S S... S ... S S... S |
| E E... E ... E E... E |
| 1 1... 1 ... 4 4... 4 |
T= | T T... T ... T T... T |
| A A... A . .. A A... A |
| R R.. .R ... R R... R |
| G G... G ... G G... G |
| E E... E ... E E... E |
| T T... T ... T T... T |

Each input training sample is a 252-element column vector
Each target is a 4-element column vector


Is this a correct means of inputting the data? I have worked myself
into circles about it.
Thanks for reading this far!

Greg Heath

unread,
Nov 13, 2009, 1:16:50 AM11/13/09
to
On Nov 12, 8:21 am, "Philip O'Brien" <obrien.phili...@gmail.com>
wrote:

See the FAQ for the correct use of terminology.
My post on pretraining advice may also be useful.

You have a sample of N training cases or observations. Each case
consists of an input vector with Nvarin variables and an output
target
vector with Nvarout variables. For a classifier that assigns input
vectors
into 1-of-c classes, chose Nvarout = c and target vectors of the ith
class
as the ith column of the c-dimensional unit matrix. Assignments are
made
to the class corresponding to the output with the maximum value.

If you are using MATLAB, the dimensions of the input and target
matrices
are

size(p) = [Nvarin N]
size(t) = [Nvarout N] = [c N].

Hope this helps.

Greg

Philip O'Brien

unread,
Nov 13, 2009, 9:24:11 AM11/13/09
to
Hi Greg, thank you for taking the time to respond. I'm not sure what
terminology I am using incorrectly, I thought I was right but clearly
not.

> You have a sample of N training cases or observations. Each case consists of an input vector with Nvarin variables and an output
> target vector with Nvarout variables.
Each input vector consists of 272 elemtents, i.e. a single column, 272
row vector
Each target vector consists of 4 elements, i.e. a single column, 4 row
vector
I grouped all the training cases (40 in total, 10 for each of the four
subjects) into one matrix, a 272 row by 40 column matrix, I am correct
in having this as my training matrix. My target matrix, T, is then a 4
row by 40 column matrix.

I have read through your pretraining advice (thank you, I found it
very informative). I tried both prestd and premnmx (not at the same
time) but didn't notice an improvement.I did this by applying it to
each input case before forming the matrix, i.e. prestd(case1), and
then I placed this as a column in the matrix and so on.

>size(p) = [Nvarin N]
>size(t) = [Nvarout N] = [c N].

Nvarin is the number of elements of each particular training case?
(272), Nvarout = 4? Am I correct in this?

Thank you for offering your advice Greg, I have been pouring over any
literature I could regarding this but was unsure if I was going down a
dead-end.

Kind regards

Greg Heath

unread,
Nov 13, 2009, 10:25:34 PM11/13/09
to
On Nov 13, 9:24 am, "Philip O'Brien" <obrien.phili...@gmail.com>
wrote:

> Hi Greg, thank you for taking the time to respond. I'm not sure what
> terminology I am using incorrectly, I thought I was right but clearly
> not.> You have a sample of N training cases or observations. Each case consists of an input vector with Nvarin variables and an output
> > target vector with Nvarout variables.
>
> Each input vector consists of 272 elemtents, i.e. a single column, 272
> row vector
> Each target vector consists of 4 elements, i.e. a single column, 4 row
> vector
> I grouped all the training cases (40 in total, 10 for each of the four
> subjects) into one matrix, a 272 row by 40 column matrix, I am correct
> in having this as my training matrix. My target matrix, T, is then a 4
> row by 40 column matrix.
>
> I have read through your pretraining advice (thank you, I found it
> very informative). I tried both prestd and premnmx (not at the same
> time) but didn't notice an improvement.I did this by applying it to
> each input case before forming the matrix, i.e. prestd(case1), and
> then I placed this as a column in the matrix and so on.

Apply it to the whole matrix at once

pn = prestd(p);

> >size(p) = [Nvarin N]
> >size(t)  = [Nvarout N] = [c N].
>
> Nvarin is the number of elements of each particular training case?
> (272), Nvarout = 4? Am I correct in this?

Yes

> Thank you for offering your advice Greg, I have been pouring over any
> literature I could regarding this but was unsure if I was going down a
> dead-end.

You are welcome.

Greg

0 new messages