neural network how to orgnize the data

I have a problem with nn classification ,I have 19 different classes , each class has 20 features and each feature has 200 samples(it could be more in future), how should I orgnize the input matrix ? is it 20 x (200*19) or (20 *19) x 200 , and the target 1 x (200 * 19) is that right ? or should I use eye() as I read in some answers? another question is how to decide the most appropirate number of hidden layers(middle layers not input and output) and number of nerouns in each layer ? the last thing .. neural network provide different results each run .. is it possible to save the best run net configration and use it later to provide the same or approximated results ??
thanks in advance

 Accepted Answer

[ I N ] = size(input) % [20 200 ]
[ O N ] = size(target) % [ 19 200 ]
If you made a mistake and each class has 200 samples then
[ I N ] = size(input) % [20 1800 ]
[ O N ] = size(target) % [ 19 1800 ]
For classification design posts, search the NEWSGROUP and ANSWERS using
greg patternnet
Hope this helps
Greg

7 Comments

thank you very much for the quick reply ,, just to make sure that I understood it well, [20 200] represnts one class ,, if I want all classes that means it will be [380 200] is that right?? one more thing how the target will be in size [19 200]?, should I use eye() and replace ones with class value or just repeat the target value for the whole row,,, many thanks again and I appreciate your reply
Your description is not clear.
For c classes with N I-dimensional input column vectors
size(input) = [ I N ]
size(target) = [ c N ]
where the target vectors are {0,1} c-dimensional unit column vectors.
Greg
the total number of input is [380 200] for 19 classes, each [20 200] represents a class with only one value , ex: [1:20 200] represents class 0 ,[21:40 200] represents class 5 , [41:60 200] represents class 10 and so on , the target vector is [0:5:90]
No! Reread my answer and comment.
I = 20 , c= 19 and N = 1800
I am really sorry that I didn't unstand it ,but in the answer you wrote
[ I N ] = size(input) % [20 1800 ]
[ O N ] = size(target) % [ 19 1800 ]
this confused me ,, what is the 1800?? did you mean 180? and tha target matrix is my problem ,you said {0,1} 19 dimensional unit column vector,, if it is all zeros and ones , how the network will classify to 0,5,10...etc , would you please explain more about target,,sorry again sir and I appreciate your patience
end
CORRECTION:
Each of 19 classes has 200 examples of 20 dimensional column feature vectors.
[ I N ] = size(input) % [ 20 3800 ]
[ O N ] = size(target) % [ 19 3800 ]
The columns of the target are the columns of eye(19). Class indices are 1:19
The transformations between target and true class indices and between output and estimated class indices are
truclassindices = vec2ind(target);
target = ind2vec(truclassindices);
...
output = net(input);
estclassindices = vec2ind(output);
Hope this helps.
Thank you for formally accepting my answer
Greg
Thank you very very much Prof.Greg Heath ,and special appreciation for your patience

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!