Assume you have O (O>2) classes, O output nodes, and N targets that are columns of the O-dimensional unit matrix eye(O). Then
[ tmax targetclasses ] = max(t)
or
targetclasses = vec2ind(t)
With purelin, logsig, or softmax output activation units,
[ ymax outputclasses ] = max(y)
or
outputclasses = vec2ind(y)
Nerr = numel(outputclasses ~= targetclasses)
Note:
If you use purelin, sum(y) = 1
If you use logsig, 0 < y < 1
If you use softmax, 0 < y < 1 and sum(y) = 1 % Valid posterior probabilities
Hope this helps.
Greg
