How to fix LSTM Model that returns value for epoch size during training different from that in code.
1 view (last 30 days)
Show older comments
I have this LSTM model constructed for time series analysis. with parameters as such
numFeatures = 6
numHiddenLayers = 100
numResponse = 1
Layers = [...
sequenceInputLayer(numfeatures);...
lstmLayer(numHiddenLayer, "OutputMode", "last")
fullyConnectedLayer(numResponses)
reluLayer
regressionLayer
];
miniBatchSize = 24
Epoch = 50
options = trainingOptions("adam",...
"ExecutionEnvironment", "auto",...
"MaxEpoch", Epoch, ...
"MiniBatchSize", miniBatchSize,...
"Plots","training-progress");
Now during trainig the Epoch size is kept constant at 30, even though I set it to 50 in code. please how can I fix this and what is the cause?
0 Comments
Answers (1)
Ashutosh
on 25 May 2023
Edited: Ashutosh
on 25 May 2023
Hi,
I am assuming that you are using the R2023a distribution of MATLAB. In that case, your method of assigning name-value arguments ("MaxEpoch", Epoch,"MiniBatchSize", miniBatchSize etc) may not be valid, instead you may have to use Name=Value format. Refer to the MATLAB Documentation for trainingOptions, more specifically the section for Name-Value Arguments. Note that the comma method is used for pre-R2021a as mentioned. Note also, that the default value for epochs is 30 which is being assigned in your case. It should work as intended if you give the options as below:
options = trainingOptions("adam",...
ExecutionEnvironment = "auto",...
MaxEpochs = Epoch, ...
MiniBatchSize = miniBatchSize,...
Plots = "training-progress");
Hope this helps!
0 Comments
See Also
Categories
Find more on Pattern Recognition and Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!