understanding the output of neural network using the neural network toolbox in R2013b

1 view (last 30 days)
I am using the Matlab neural network toolbox in code form, for classification. When I use the statement y = net(x), after having trained the net, I get two rows of outputs, instead of one. What I have understood from the output is that it gives the probability of each samples belonging to class 1 or class 2. The first row of output indicates class 1, and the second row indicates class 2.
Why is the output given in this way, shouldn't there be just one value for each data sample, indicating which class it belongs to? Is this because softmax transfer function has been used?
Or am I making a mistake in understanding the output pattern?

Accepted Answer

Greg Heath
Greg Heath on 7 Sep 2016
There are two approaches to classification when the c classes are exclusive. Exclusive classes means that the targets are zero/one unit vectors and the outputs should also be unit vectors with the largest component indicating the correct class. Softmax is the appropriate output layer function.
However, since the output components should sum to 1, sometimes a c-1 dimensional output with a logsig output function is used and the posterior probability of the cth class is estimated by subtracting the sum of the c-1 other outputs from unity.
With modern computers I don't think the space saving losig method is worth the effort.
Hope this helps.
Thank you for formally accepting my answer
Greg

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!