Time Series and input layer Error

조회 수: 1 (최근 30일)
Kyle Fredin
Kyle Fredin 2019년 8월 1일
댓글: Kyle Fredin 2019년 8월 5일
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 );

채택된 답변

Divya Gaddipati
Divya Gaddipati 2019년 8월 5일
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
Kyle Fredin
Kyle Fredin 2019년 8월 5일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by