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
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
Best Answer