How is it possible to use a validation set with a LSTM?
조회 수: 11 (최근 30일)
이전 댓글 표시
When I try to use the Validation set with a LSTM layer, it shows the following error:
options = trainingOptions('adam', ...
'ExecutionEnvironment','gpu', ...
'GradientThreshold',1, ...
'MaxEpochs',maxEpochs, ...
'ValidationData',{XTest,YTest},...
'MiniBatchSize',miniBatchSize, ...
'LearnRateSchedule','piecewise', ...
'SequenceLength','longest', ...
'Shuffle','never', ...
'Verbose',0, ...
'Plots','training-progress');
net = trainNetwork(XTrain,categorical(YTrain),layers,options);
Error:
Training with validation data is not supported for networks with LSTM layers.
Is there another way to use the Validation set during the training of the network?
댓글 수: 1
Kenta
2020년 3월 14일
Now that, the use of validation data with LSTM network is available.
The example follows:
채택된 답변
Joss Knight
2018년 4월 29일
It's ugly, but if you use Checkpoints, then you can use an OutputFcn to (once per epoch) load the network from a checkpoint and run it against your validation data. It isn't very efficient, but it's okay if you're only doing it once per epoch. You won't get it on the training plot of course.
댓글 수: 10
Joss Knight
2020년 10월 6일
Hey M J, you should probably ask a new question and provide a bit more detail and code. Thanks.
M J
2020년 10월 8일
편집: M J
2020년 10월 8일
Hi, thank you for your answer. I did ask a new question (see link below) :
I do not have a code for this, as I am really not sure where to even start. Also, I am not sure if it is okay to post a link to the question here, but if not, please let me know. Thank you.
추가 답변 (2개)
Mads Bergholt
2018년 5월 17일
Dear Joss, will this be part of Matlab 2018b? This is an aspect of LSTM that is very important for validating these algorithms.
Best regards Mads
댓글 수: 3
XIANFENG XU
2018년 11월 7일
I am sorry to say that this is still not included in Matlab 2018b. Sigh. Maybe we have to turn to Tensorflow for deep learning.
Joss Knight
2018년 11월 13일
ValidationData is indeed supported for Sequence Networks in R2018b: https://www.mathworks.com/help/deeplearning/ref/trainingoptions.html#bu59f0q_sep_mw_4d4d5e80-6684-47de-986c-f9f8258b7c6d
There are some restrictions on the format of the data.
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!