How to change training and plotting options when training a deep network?

15 ビュー (過去 30 日間)
Fatma Diab
Fatma Diab 2021 年 11 月 11 日
コメント済み: Mohammad Sami 2021 年 11 月 22 日
I have Matlab R2021a and I need to modify the option ‘OutputNetwork’ from the default ('last-iteration') into 'best-validation-loss' in trainingOptions by using this command:
options = trainingOptions('OutputNetwork', 'best-validation-loss');
but this option is not found in matlab R2021a. Could you please help me?

回答 (1 件)

Mohammad Sami
Mohammad Sami 2021 年 11 月 12 日
From matlab documentation, you can only use this option if you specified validation data as well.
  • 'best-validation-loss' – Return the network corresponding to the training iteration with the lowest validation loss. To use this option, you must specify 'ValidationData'.
  2 件のコメント
Fatma Diab
Fatma Diab 2021 年 11 月 12 日
編集済み: Fatma Diab 2021 年 11 月 12 日
I have validation data and my options are:
options = trainingOptions('adam', ...
'MiniBatchSize',20, ...
'MaxEpochs',10, ...
'InitialLearnRate',0.0001, ...
'Shuffle','every-epoch', ...
'ValidationData', imdsValidation, ...
'ValidationFrequency',300, ...
'OutputNetwork', 'best-validation-loss',...
'Verbose',true, ...
'Plots','training-progress');
but this error appears:
Error using nnet.cnn.TrainingOptionsADAM (line 132)
'OutputNetwork' is not an option for solver 'adam'.
Error in trainingOptions (line 317)
opts =nnet.cnn.TrainingOptionsADAM(varargin{:});
Mohammad Sami
Mohammad Sami 2021 年 11 月 22 日
This functionality is recently introduced in Matlab R2021b.
https://www.mathworks.com/help/deeplearning/release-notes.html
Network Training: Return network with lowest validation loss
When training a neural network using the trainNetwork function, output the network with the lowest validation loss by setting the OutputNetwork name-value argument of the trainingOptions function to "best-validation-loss".
You may try using checkpoint path for this perhaps. See the available options in R2020a here
CheckpointPathPath for saving checkpoint networks
character vector
Path where checkpoint networks are saved, specified as a character vector.
Data Types: char
For more on checkpoint see here

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

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by