필터 지우기
필터 지우기

Appropriate data structure for using predictand update state for LSTM

조회 수: 1 (최근 30일)
NN
NN 2020년 12월 18일
댓글: NN 2020년 12월 22일
Hello
I am trying to fit a LSTM network for forecast time series data using using the example on this help-page i.e with the trainNetwork command :
My problem is i am using a multi input training data instead of a single column data as in example.and i am getting the below error while trying to use the predict and update command:
The prediction sequences are of feature dimension 1 but the input layer expects sequences of feature dimension 5.
net = predictAndUpdateState(net,XTrain);
[net,YPred] = predictAndUpdateState(net,YTrain(end));
numTimeStepsTest = numel(XTest);
for i = 2:numTimeStepsTest
[net,YPred(:,i)] = predictAndUpdateState(net,YPred(:,i-1),'ExecutionEnvironment','cpu');
end
my Xtrain is 5*576 double array
Ytrain is 1*576 duble array
How can i convert data from array format to use for predictandupdate command and to use in the loop.
Thanks for advance.
Please let me know if any additional inofrmation is required.

답변 (1개)

Aditya Patil
Aditya Patil 2020년 12월 22일
As per my understanding, the sizes of your Xtrain and Ytrain datasets are not matching.
The method to fix this issue will depend on the how the data is organized. If it's a single sequence of data and Xtrain has been reshaped to be of size 5 * 576, then you should be able to reshape Ytrain in similar manner.
However, if these are unrelated datasets, then it will depend on the data itself. If Xtrain has 5 features, and Ytrain has only one, you cannot use Ytrain with the same model.
  댓글 수: 1
NN
NN 2020년 12월 22일
Thank you very much for the response.I request you to please explain more about the line "If it's a single sequence of data and Xtrain has been reshaped to be of size 5 * 576, then you should be able to reshape Ytrain in similar manner".
How can i reshape Ytrain?

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by