Can target vector of neural network have sum of columns >1?

1 view (last 30 days)
i have 56 classes ( 1 , 2, .....56) as output. i want to define target vector for neural network. I have converted classes into binary and output neurons are now 6. So for each column the value is >1. Is it ok? Can u help me to write a code to convert 6 output into original classes?

Accepted Answer

Greg Heath
Greg Heath on 28 Apr 2015
No! Target columns should be columns of eye(56);
truclassindices = vec2ind(target);
target = ind2vec(truclassindices);
...
output = net(input);
estclassindices = vec2ind(output);
Hope this helps
Thank you for formally accepting my answer
Greg
  2 Comments
Greg Heath
Greg Heath on 29 Apr 2015
CORRECTION:
The above answer ASSUMED that the classes were mutually exclusive.
If the classes are NOT mutually exclusive e.g., tall, dark, handsome (excuse me for blushing), then the nonzero entries are fractions that sum to 1.
By the way, there are two forms of crossentropy: One for mutually exclusive classes and another for non-mutually exclusive classes.
I have advised MATLAB of this but they have not informed me of any upgrades.
I probably have posted something about this.
Search the NEWSGROUP and/or ANSWERS and/or comp.ai.neural-nets using
greg crossentropy
greg cross-entropy
greg cross entropy
Hope this helps.
Greg
Greg Heath
Greg Heath on 2 May 2015
CORRECTION OF THE CORRECTION
If the classes are NOT mutually exclusive e.g., tall, dark, handsome (excuse me for blushing), then the nonzero entries are fractions
THAT DO NOT HAVE TO SUM TO ONE!

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!