MATLAB Answers

RIMPI SUMAN
0

How to match the input and target file during neural network testing in my own GUI Application?

Asked by RIMPI SUMAN
on 2 May 2013

hello ,

I am Rimpi,

I need a help regarding training and testing of neural network in my own GUI application.

I generate 2 push button in GUI one for training and another for testing.

I Colleted 20 people signature images , 5 different copies of each individual that is total 100 signature images. i did pre- processing and feature extraction from each image. and i generate 20 targets for neural network training.

the dimension of input file is 7x100 and target filedimension is 20*100. after that i trained the neural network by tainlm.

but in gui during testing I want input a new test image and I extracted the 7 features of input image and save it in newinput.mat and having dimensions of 7x1. now i want to compaire newinput.mat features with all 100 images which is generated during training . if it match with 1 to 5 image that means it belong to 1st person , if it match with 6 to 10 that means it belong to 2nd person and so on upto 100 images. but the error during testing is dimension of input and targets are different.

please help me to solve it.

  0 Comments

Tags

No tags are associated with this question.

Products

No products are associated with this question.

1 Answer

Answer by Greg Heath
on 5 May 2013

Your targets should be columns of the 20-dimensional unit matrix. The row index of the "1" is the true class index. The relationship between the target matrices and corresponding class indices is

 target = ind2vec(truclassindex)
 truclassinddex = vec2ind(target)

Outputs, classifications and errors are given by

 output         = net(input);
 assignedclass = vec2ind(output)
 Errors =  assignedclass~-truclassindex)

Hope this helps.

Greg

Thank you for formally accepting my answer

  1 Comment

Whoops! That's the command line approach; not the GUI


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!