MATLAB: Am i getting zero neurons in output layer of pattern net

outputlayerpatternnettutorial

i m using patternnet for satellite image classification.NO training is done and performance shown is also zero when i try to train my neural network. when i run command view(net), it shows me zero neurons in output layer. what is the reason?

Best Answer

Unlike the obsolete functions newfit, newpr, newff, etc, that are created from x and t, the current functions fitnet, patternet, feedforwardnet etc, are NOT created with input nodes, output nodes, input weights, layer weights or output biases; ONLY hidden nodes and input biases. The rest are assigned only after x and t are introduced via the functions configure or train. The command init(net) is ineffective at this stage. For example, paste into the command line WITHOUT THE ENDING SEMICOLON
clear all, clc
net = patternnet
Nw = net.numWeightElements
biases = net.biases
b = net.b
inputWeights = net.inputWeights
IW = net.IW
layerweights = net.layerweights
LW = net.LW
Now repeat the last 7 commands after
1. init(net);
and
2. Either
net = configure(net, x, t)
or
[net tr y e ] = train(net, x, t)
Obviously, syntax was changed to accommodate future changes in the NNToolbx. You will have to ask the MATLAB staff for details.
Hope this helps.
Thank you for formally accepting my answer
Greg