How is it possible to use a validation set with a LSTM?

32 Ansichten (letzte 30 Tage)
Sofía
Sofía am 26 Apr. 2018
Bearbeitet: M J am 8 Okt. 2020
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?

Akzeptierte Antwort

Joss Knight
Joss Knight am 29 Apr. 2018
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 Kommentare
Joss Knight
Joss Knight am 6 Okt. 2020
Hey M J, you should probably ask a new question and provide a bit more detail and code. Thanks.
M J
M J am 8 Okt. 2020
Bearbeitet: M J am 8 Okt. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Mads Bergholt
Mads Bergholt am 17 Mai 2018
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 Kommentare
XIANFENG XU
XIANFENG XU am 7 Nov. 2018
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
Joss Knight am 13 Nov. 2018
There are some restrictions on the format of the data.

Melden Sie sich an, um zu kommentieren.


Mads Bergholt
Mads Bergholt am 20 Mai 2018
thanks Joss

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by