Time Series and input layer Error

1 vue (au cours des 30 derniers jours)
Kyle Fredin
Kyle Fredin le 1 Août 2019
Commenté : Kyle Fredin le 5 Août 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 );

Réponse acceptée

Divya Gaddipati
Divya Gaddipati le 5 Août 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 commentaire
Kyle Fredin
Kyle Fredin le 5 Août 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by