Neural Network Toolbox Turn off Early Stopping

18 ビュー (過去 30 日間)
Christophe Patyn
Christophe Patyn 2017 年 4 月 6 日
編集済み: orlem lima dos santos 2018 年 1 月 30 日
Hi,
I need to make a training algorithm such as trainlm or traingd overfit. Therefore I want to turn off early stopping. The following is my code:
net = feedforwardnet(neurons,trainalgo);
net = init(net);
%net.trainParam.max_fail = max_fail;
net.divideFcn = 'dividerand';
net.divideParam.trainRatio=trainRatio;
net.divideParam.valRatio=valRatio;
net.divideParam.testRatio=testRatio;
net.trainParam.epochs = epochs;
net.trainParam.min_grad=0;
% Train network and retrieve mse's.
[net tr] = train(net, x, y);
trE = tr.perf;
vE = tr.vperf;
tE = tr.tperf;
I want the min_grad to be irrelevant. Even if it's zero I still want it to continue to train until epoch 1000. How do I do that?
Thanks

回答 (2 件)

Greg Heath
Greg Heath 2017 年 4 月 7 日
Set the training goal to 0
and
set the allowed no. of validation increases to inf.
Hope this helps.
Thank you for formally accepting my answer
Greg

orlem lima dos santos
orlem lima dos santos 2018 年 1 月 30 日
編集済み: orlem lima dos santos 2018 年 1 月 30 日
hello there is no straightforward way to do this, but you can
1. set trainRatio = 1, valRatio=0 and testRatio=0 (this stops the validation checks).
2. set the training goal to 0.
3. set net.trainParam.min_grad=1e-100; (the gradient is never going to achieve 1e-100)
this only the only way to the training stop is when it achieves the maximum number of epochs (net.trainParam.epochs)
I hope it helps

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by