MLP using the Deep Learning Toolbox; Iteration per epoch is 1 in every epoch.

2 Ansichten (letzte 30 Tage)
I am training a MultiLayer Perceptron using the Deep Learning Toolbox. I have specified the size of Mini Batch training. However, while training on every epoch, the model trains through the entire dataset once and does not iterate over the different batches of data.
This is the code.
% Network Architure
networkLayers = [sequenceInputLayer(1122,'Name','Input')
fullyConnectedLayer(750,'Name','Hidden')
reluLayer('Name','ReLU-Activation1')
dropoutLayer(0.4,'Name','dropout_Regularization')
fullyConnectedLayer(1,'Name','Output')
reluLayer('Name','ReLU-Activation2')
regressionLayer('Name','RegressionOutput')];
% Parameter setting
XValidation = features(:, 80:99);
YValidation = target(:, 80:99);
maxEpochs = 60;
miniBatchSize = 20;
validationFrequency = floor(numel(target)/miniBatchSize);
options = trainingOptions('adam', ...
'MaxEpochs',maxEpochs, ...
'MiniBatchSize',miniBatchSize, ...
'InitialLearnRate',0.01, ...
'GradientThreshold',1, ...
'Shuffle','never', ...
'Plots','training-progress',...
'Verbose',0);
net=trainNetwork(features,target,networkLayers,options);

Akzeptierte Antwort

Nomit Jangid
Nomit Jangid am 24 Sep. 2020
Hi Ritu,
If your input data is in a M x N matrix format (where, M = number of parameters and N = number of observations ) MATLAB assumes that this is a single observation problem with M time-series each being N points long. For each epoch, we have only 1 iteration and so the mini-batch size option is ignored because it doesn't apply to just 1 observation.
If you'd like to break the time-series into smaller chuncks of data that are treated as different observations, you can do that using the sequenceLength parameter in trainingOptions, by providing a positive integer with the desired sequence length:
I hope this helps.
  2 Kommentare
Ritu Panda
Ritu Panda am 1 Okt. 2020
Thank you so much. I tried to resolve it by the using the adamupdate function from the DL toolbox. I felt like it gave me more control over the execution of the program. But I will look into this solution as well.
Joachim Greck
Joachim Greck am 12 Mär. 2021
Hello,
I have encountered the same issue and modifying the Sequence Length did solve the problem. Nevertheless, do you know a way to pre-condition my training data in a way that Matlab will automatically see it as a multiple observation problem ?
Thank you for your help,
Regards

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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