Appropriate data structure for using predictand update state for LSTM
2 ビュー (過去 30 日間)
古いコメントを表示
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
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.
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!