Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: number of hidden layer nodes in neural network fitting function
Replies: 1   Last Post: Aug 16, 2013 7:36 AM

 Messages: [ Previous | Next ]
 Greg Heath Posts: 6,387 Registered: 12/7/04
Re: number of hidden layer nodes in neural network fitting function
Posted: Aug 16, 2013 7:36 AM

"FRUIT" wrote in message <ktvpoa\$hrt\$1@newscl01ah.mathworks.com>...
> In am using neural network fitting function with four input neuron one hidden layer/the matlab default/ and one output neuron for prediction. I start using 10 hidden layer neurons.
> 1. My problem is how can measure the performance

help fitnet

doc fitnet

[X,T] = simplefit_dataset;
net = fitnet; % (no semicolon) to see the default properties
rng(0)
[ net tr Y E ] = train( net, X, T);
output = Y; % Y = net(X);
error = E; % E=T-Y
perf = mse(E)
trainingrecord = tr % (no semicolon) to see what it contains

stopcrit = tr.stop
numepochs = tr.num_epochs
bestepoch = tr.best_epoch
MSEtrn = tr.best_perf % = tr.perf(bestepoch+1)
MSEval = tr.best_vperf
MSEtst = tr.best_tperf

and when to stop increasing the hidden layer nodes?

Search for examples of my code in the NEWSGROUP

> 2. In training the network; when shall I stop, am not clear on the performance metrics.

The defaults will choose when to stop. See stopcrit above to find the cause.

> 3. How can I test the nnfit for new data?

newoutput = net(newinput);

Hope this helps.

Greg

Date Subject Author
8/8/13 FRE
8/16/13 Greg Heath