How to change learning rate and momentum in 'trainlm' neural network?

9 ビュー (過去 30 日間)
Avanthi Saumyamala
Avanthi Saumyamala 2018 年 11 月 2 日
コメント済み: Katy 2023 年 7 月 19 日
I have a feed forward neural network trained with trainlm function.Now i want to change the learning rate and momentum.Is there a specific default range for learning rate or Do I need to find the optimum range for learning rate?

採用された回答

GW
GW 2018 年 11 月 2 日
編集済み: GW 2018 年 11 月 2 日
use
options = trainingOptions('sgdm',...
'MaxEpochs',60, ...
'LearnRateDropFactor',0.1,...
'LearnRateDropPeriod',1,...
'LearnRateSchedule','piecewise',...
'ValidationData',{valImages,valLabels},...
'ValidationFrequency',50,...
'Momentum',0.85,...
'ValidationPatience',5,...
'InitialLearnRate',0.1,...
'MiniBatchSize',128,...
'Verbose',true,...
'executionenvironment','cpu',...
'Shuffle','every-epoch',...
'Plots','training-progress');
net = trainNetwork(...,...,...,options);
and choose the parameters accordingly.
For default values, see the docs of trainingOptions.
In terms of the learning rate and momentum, I typically start with a large one just to test the general behaviour and then I drop the learning rate to get more accurate results. Its difficult to give you some concrete advice because the optimal learning rate depends on your specific problem.
  3 件のコメント
Pendar  Arzandeh
Pendar Arzandeh 2022 年 5 月 25 日
Could you explain about trainlm? How to change learning rate? matlab allow changing mu and Gradient
Thanks
Katy
Katy 2023 年 7 月 19 日
Is there a solution for this? I am also trying to change the learning rate with 'train' and 'trainlm' functions. Thanks!

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by