Error using predictAndUpdateState (LSTM NN)

5 ビュー (過去 30 日間)
NATALIA ARREGUI GONZALEZ
NATALIA ARREGUI GONZALEZ 2020 年 5 月 4 日
回答済み: Pjeter Berisa 2022 年 10 月 25 日
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
  1 件のコメント
NN
NN 2020 年 12 月 18 日
following

サインインしてコメントする。

回答 (2 件)

Vineet Joshi
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)
ans = 'network'
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:

Pjeter Berisa
Pjeter Berisa 2022 年 10 月 25 日

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by