My input vector is a 130*85 matrix and my target vector is 130*26 matrix. I am using the below parameters for training the network with 60 hidden nodes. net.trainParam.max_fail = 50; net.trainParam.min_grad=1e-10; net.trainParam.show=10; net.trainParam.lr=0.01; net.trainParam.epochs=1000; net.trainParam.goal=0.001;` As you can see I have set the max_fail to 50 and min_grade to 1e-10. While the default values will be 6 and 1e-5 respectively. But with the default values, the training stops early with out reaching the performance goal. By setting these parameters,the training is stopped when the performance goal is reached. So. Is it OK to change these parameters?
Kshitij Singh answered .
2025-11-20
mse(ytst-ttst)/var(ttst,1) <= 0.01
MSEgoal = max( 0, 0.01*(Ntrneq-Nw)*var(ttrn,0)/Ntrneq ) MinGrad = MSEgoal/100 net.trainParam.goal = MSEgoal ; net.trainParam.min_grad = MinGrad ;
[ I N ] = size(input) % [ 85 130 ]
[ O N ] = size(target)% [ 26 130 ]
Ntrn = N-2*round(0.15*N) % 90 training examples
Ntrneq = Ntrn*O % 2340 training equations
% Nw = (I+1)*H+(H+1)*O % Number of unknown weights
% For a robust design desire Ntrneq >> Nw or
% H << Hub = -1+ceil( (Ntrneq-O) / (I+O+1)) % 20
Hmax = 20
dH = 2
Hmin = 1
Ntrials = 10
Design many nets and choose the best using the validation set performance.
for h = Hmin:dH:Hmax
....
for i = 1: Ntrials
...
end
end
greg Ntrials