Is it OK to increase validation checks and decrease min gradient while training neural network?

조회 수: 8 (최근 30일)
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?

채택된 답변

Greg Heath
Greg Heath 2014년 4월 20일
편집: Greg Heath 2014년 4월 20일
The most important objective is to obtain an acceptable ratio of mean-square error to mean-target-variance for RANDOM subsets of NONTRAINING data. I find the best way to do this is to try to find the smallest value of H (No. of hidden layer nodes) that will yield
mse(ytst-ttst)/var(ttst,1) <= 0.01
i. e., 99% of a random test target subset variance is successfully modeled.
In order to do this I use the default 70/15/15 trn/val/tst data division and the training data goals
MSEgoal = max( 0, 0.01*(Ntrneq-Nw)*var(ttrn,0)/Ntrneq )
MinGrad = MSEgoal/100
net.trainParam.goal = MSEgoal ;
net.trainParam.min_grad = MinGrad ;
For an I-H-O node topology obtained from N pairs of I-dimensional inputs and O-dimensional targets
[ 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
I have posted many, many examples on the NEWSGROUP and ANSWERS, Search on
greg Ntrials
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 2
Greg Heath
Greg Heath 2018년 6월 4일
The question is not relevant to obtaining a good design. The answer is oriented to guide the questioner to more relevant issues.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

papoo
papoo 2015년 1월 14일
Thanks Greg, so useful.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by