Validation Frequency - CNN Training

48 ビュー (過去 30 日間)
Andrea Daou
Andrea Daou 2021 年 1 月 18 日
移動済み: Arkadiy Turevskiy 2024 年 1 月 11 日
Hello,
I have a question concerning the validation frequency in options when fine-tuning a pretrained network (image classification problem) :
opts = trainingOptions('sgdm', 'InitialLearnRate', 0.001,...
'MaxEpochs', 10, 'MiniBatchSize', 32,...
'Shuffle','every-epoch','Verbose',true, ...
'ValidationData',augmentedTestSet, ...
'ValidationFrequency',valFrequency, ...
'Plots','training-progress');
mynet = trainNetwork(augmentedTrainingSet, lgraph, opts);
How can I choose the best valFrequency value for my model ?
Thank you !!

採用された回答

Ullah Nadeem
Ullah Nadeem 2022 年 10 月 20 日
移動済み: Arkadiy Turevskiy 2024 年 1 月 11 日
Hello Andrea!
VF: Validation Frequency
As far as I know, the selection of validation frequency depends on the following:
(1) The amount of training data
If the training data is large and the VF if small number (let's say after 30 iterations), the model will not learn enough while validating more oftenly results in long training time and maybe stop the training early if the 'ValidationPatience' is not set to 'Inf'.
(2) How fast the model learns the data well
If a problem is easy and the model learns it quickly, the VF supposed to be in range of 1/15th times of the iterations/epoch to 1/7th times of the iterations/epoch to let the network stop early and not gets overfit. But if the problem is complicated and model can't learns it quickly, then it is better to select the VF in range of 1/7th times of the iterations/epoch to 1/3th times of the iterations/epoch to let the model learns enough before validating.
Note: Iterations/epoch can be calculated as total number of training samples/mini-batch size.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by