Time Series and input layer Error

1 Ansicht (letzte 30 Tage)
Kyle Fredin
Kyle Fredin am 1 Aug. 2019
Kommentiert: Kyle Fredin am 5 Aug. 2019
XTrain = dataTrainStandardized(1:end-1);
YTrain = dataTrainStandardized(2:end);
numFeatures = 1;
numResponses = 1;
numHiddenUnits = 200;
layers = [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits)
fullyConnectedLayer(numResponses)
regressionLayer];
options = trainingOptions('adam', ...
'MaxEpochs',250, ...
'GradientThreshold',1, ...
'InitialLearnRate',0.005, ...
'LearnRateSchedule','piecewise', ...
'LearnRateDropPeriod',125, ...
'LearnRateDropFactor',0.2, ...
'Verbose',0, ...
'Plots','training-progress');
net = trainNetwork(XTrain,YTrain,layers,options);
net = trainNetwork(XTrain,YTrain,layers,options); >>>> ***Error using trainNetwork (The training sequence are of feature dimention 5353 but the input layer expects sequences of feature dimention 1).
I'm trying to work a collegues code from a previous MLab version. Since I'm using R2019a, is there an issue with the DAGNetwork because it's crashing at "iThrowCNNException( e );

Akzeptierte Antwort

Divya Gaddipati
Divya Gaddipati am 5 Aug. 2019
From the error you received, I can see that your input data is of size 5353.
But, from line 3 of your code, you are defining the input size (numFeatures) of your sequenceInputLayer as 1, whereas it should be defined as 5353.
  1 Kommentar
Kyle Fredin
Kyle Fredin am 5 Aug. 2019
Thank you, Divya.
What I ended up doing, and it may not be the best coding practice, was to execute a rot90(data) earlier up in the code after the data ingest. This did the trick. It comes in at 5335x1 and the training structure was appearently looking for 1x5335.
Still not sure how this fully operates yet. Still some learning to do. Thx again for you time.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by