Always start with default values. If they don't work, change one at a time.
You have two hidden layers. One is sufficient.
close all, clear all, clc
[ p, t ] = simplefit_dataset;
whos
[ I N ] = size( p)
[ O N ] = size( t)
Ntst = round(0.15*N)
Nval = Ntst
Ntrn = N-2*Ntst
Ntrneq = Ntrn*O
% Nw = (I+1)*H+(H+1)*O % No. of unknown weights
% Ntrneq > Nw when H < = Hub
Hub = -1 + ceil( ( Ntrneq-O)/(I+O+1) )
H = 10
Nw = O + (I+O+1)*H
% Initialize RNG so default random data division and random initial weights can be duplicated
rng(0)
net = newff( p, t, H );
view(net)
[ net tr y0 e0 ] = train( net, p, t );
y = net(p);
e = t-y;
MSE = mse(e)
tr = tr
% New data
Hope this helps.
Thank you for formally accepting my answer
Greg
P.S. See tr for the separate training, validation and test results !
Best Answer