Input format to the neural network

6 views (last 30 days)
Hi everyone,
My question is how's the suitable and available format of neural network training input and target ?
I hope the answer to depend on an example ,for example if my input consists of (10) classes or patterns , and for each pattern there're (5) samples , and a feature vector of length (20) is extracted from each sample . what's the suitable format of the file that contains these training dataset? and what's the format of the input (p) and target (t) to the neural network toolbox in matlab ?
After searching I understand that the feature vector elements for each class is ordered as rows , and the columns express the multiple classes or patterns , am I right ? if no , then correct that to me please , and if yes , I still want to know about the different samples of the same pattern , do I deal with them as separate classes and specify its target separately ? or what ?
please don't answer me like this :
[ I N ] = size(input)
[ O N ] = size(target)
If you don't mind, use my above example numbers instead to understand you perfectly .
Thanks in advance
  1 Comment
aurora
aurora on 25 Oct 2012
Edited: aurora on 25 Oct 2012
Is it like this :
- the rows of input matrix = 20 (the feature vector length)
- the columns of input matrix = 10x5 =50 (no. of classes x no. of samples per class)
- the rows of the target matrix = 10 (the number of outputs)
- the columns of the target matrix= 10*5=50 (no. of classes x no. of samples per class)
=> size(input)=[20 50] & size(target)=[10 50]
???
help!

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 25 Oct 2012
[ I N ] = size(input)= [ 20 50 ]
[ O N ] = size(target)= [ 10 50 ]
If you use PATTERNNET with it's default batch learning algorithm, the order of the individual inputs is irrelevant as long as they are paired with the correct target class vector.
The order that is easiest for me to demonstrate is
target = repmat(eye(10),1,5);
Hope this helps.
Thank you for formally accepting my answer.
Greg
  3 Comments
Greg Heath
Greg Heath on 26 Oct 2012
Yes. The numbers in your previous comment are correct.
I think NEWPR is available in 2010a. NEWFIT and NEWPR are just modified versions of NEWFF that are specialized for regression and curvefitting(NEWFIT) or pattern recognition and classification (NEWPR).
If you use the commands
type newpr
type newfit
you can see that a few modifications are made before and after an internal call to NEWFF.
However, you can still use NEWFF if you wish. Nevertheless you should check to see the few modifications that were made in NEWFIT and NEWPR.
Similarly for the new versions:
FITNET replaces NEWFIT
PATTERNNET replaces NEWPR
and
FEEDFORWARDNET replaces NEWFF.
No I meant the obvious: If input column 17 is a class 3 vector then target column 17 should have a "1" in row 3.
No. The number of columns in the input and target matrices must be equal.
aurora
aurora on 27 Oct 2012
Thank you very much all my questions until now is replied by you , I really appreciate your help .
Best Regards

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!