How to crete Input and Target data for Neural Network Training?

2 views (last 30 days)
I have character dataset for handwriting recognition from 110 users. Each user writes 110 different characters twice. So basically there are 110*110*2 images in total. I wrote a feature extraction code and now have 80 features per image (character). The FE code has created 110 text files representing each character i.e. one file represents one of the 110 characters from all the users. Each file has name of the user and image number followed by 80 features separated by comma. Since there are 110 characters to be recognized, I know there should be 110 classes but I am not sure how to create matrices for input and target so the dimensions match. Could someone please help me, how can solve this problem.

Accepted Answer

Greg Heath
Greg Heath on 15 Mar 2015
N = 110*110*2 % 24200
[ I N ] = size(input) % [ 80 N ]
[ O N ] = size(target) % [ 110 N ] e.g, [ repmat(eye(110), 1, 220)]
Hope this helps.
Thank you for formally accepting my answer
Greg
  2 Comments
Harsimrat Parmar
Harsimrat Parmar on 16 Mar 2015
Thank you so much for your reply. It helped me create my input matrix but I am still struggling with the target matrix.
>> whos
Name Size Bytes Class Attributes
data 22289x84 14978208 double
This is my input matrix. How can I create my target matrix for these dimensions.
Also I am confused about how will the learning take place. A particular row in input matrix must be mapped to a target row (I think) for the NN to learn which class is represented by that row. Please correct me if I am wrong. If this is correct, how will the mapping between the input and target rows be done?
Greg Heath
Greg Heath on 17 Mar 2015
help vec2ind
doc vec2ind
help ind2vec2
doc ind2vec2
For examples search the NEWSGROUP and ANSWERS using
patternnet ind2vec vec2ind

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!