When I set net.trainP​aram.epoch​s=5000, the max epoch is still 1000 in GUI

14 ビュー (過去 30 日間)
DAR VON
DAR VON 2017 年 12 月 4 日
コメント済み: Greg Heath 2017 年 12 月 8 日
I can't change the max epoch using net.trainParam.epochs.
  2 件のコメント
Elizabeth Reese
Elizabeth Reese 2017 年 12 月 6 日
Can you post how you created the network? It would be helpful to see the code that reproduces this issue. Sometimes the order of changing different parameters and options can reset values back to their defaults and 1000 is the default epoch value for the training functions.
DAR VON
DAR VON 2017 年 12 月 7 日
function net = network_train(train_data,train_label)
layer=25;
net=newff(train_data,train_label,layer);
net.trainParam.epochs=5000;
net.trainParam.lr=0.01;
%net.trainParam.lr=lr;
net.trainParam.goal=0.001;
net.trainParam.show=50;
net.trainParam.max_fail=500;
net.trainFcn='trainscg';
net=train(net,train_data,train_label);
end
Thanks a lot.

サインインしてコメントする。

採用された回答

Elizabeth Reese
Elizabeth Reese 2017 年 12 月 7 日
Thank you for posting your code.
Based on the Neural Network Toolbox documentation here, updating the net.trainFcn will reset the net.trainParam to the default values for the new function. So changing the net.trainFcn to trainscg changes the net.trainParam to the defaults listed here. These defaults include having the epochs set to 1000.
To fix this, just move the assignment to the net.trainFcn to before any updates to the net.trainParam.
  2 件のコメント
DAR VON
DAR VON 2017 年 12 月 7 日
Would you please tell me how can I use GPU to accelerate computation in projects like BP, thanks a lot.
Greg Heath
Greg Heath 2017 年 12 月 8 日
Why didn't you post this as a new question?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange时序、序列和文本深度学习 についてさらに検索

Community Treasure Hunt

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

Start Hunting!