Error using predictAndUpdateState (LSTM NN)
5 ビュー (過去 30 日間)
古いコメントを表示
Hello guys,
I am trying to conduct a regression analysis using a LSTM neural network.
I am using 8 variables as input, and obtaining 1 output.
My knowledge in Deep Learning Toolbox is limited, therefore I have used Neural Network Fitting App to create the network.
Once exported, I am trying to predict into the future using the function predictAndUpdateState. However, I keep getting the same error message:
% Xnew is a cell array with the 8 inputs I want to use to predict.
>> for i = 2:numTimeStepsTest
v = Xnew(:,i);
[net1,score] = predictAndUpdateState(net1,v);
scores(:,i) = score;
end
Undefined function 'predictAndUpdateState' for input arguments of type 'network'.
As I understand, a LSTM network is a recurrent neural network, therefore I don't know where the mistake could be.
As I said, my knowledge is very limited, so I would appreciate any help on this matter.
Many thanks,
Natalia
回答 (2 件)
Vineet Joshi
2021 年 10 月 26 日
Hi!
Background:
In the following code I have used the command line equivalent of 'Neural Network Fitting App' to create a simple network.
trainFcn = 'trainlm';
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize,trainFcn);
class(net)
As you can see the 'fitnet' returns a network of type 'network'.
From the error shared by you, it looks like your case is same as well since input argument is of type 'network'.
Understanding the Error:
The documentation of predictAndUpdateState states that the input network can be of two types only. It can either be a SeriesNetwork object or a DAGNetwork object.
Possible Workaround:
The most strightforward workaround is to create a SeriesNetwork object or a DAGNetwork object. Attaching a few links to help you with this.
Helpful Links:
0 件のコメント
Pjeter Berisa
2022 年 10 月 25 日
I think the root problem is the same as discussed in this question:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!