Could anyone please help me with an example of LSTM network matlab code.

1 回表示 (過去 30 日間)
jaah navi
jaah navi 2021 年 6 月 11 日
コメント済み: Steven Lord 2021 年 6 月 11 日
numFeatures = 12;
numHiddenUnits1 = 125;
numHiddenUnits2 = 100;
numClasses = 9;
layers = [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits1,'OutputMode','sequence')
dropoutLayer(0.2)
lstmLayer(numHiddenUnits2,'OutputMode','last')
dropoutLayer(0.2)
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
  1 件のコメント
Steven Lord
Steven Lord 2021 年 6 月 11 日
That appears to be the last example in the "Deeper LSTM Networks" subsection on this documentation page. Since you've found that page it's not clear what type of help you're looking for. Please explain what you want in more detail.

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

回答 (3 件)

jaah navi
jaah navi 2021 年 6 月 11 日
As I am not clear with LSTM time series in the matlab code, i need a clear explanation with a sample matlab code that can perform time series using LSTM.

Steven Lord
Steven Lord 2021 年 6 月 11 日
One of the "Related Topics" listed at the end of the documentation page to which I linked in my comment on the question is "Time Series Forecasting Using Deep Learning". Is the process described on that page what you mean by "perform time series using LSTM"? If you don't want to use the time series data to forecast the values of your series at future times, what do you want to do?

jaah navi
jaah navi 2021 年 6 月 11 日
Actually i want to implement LSTM in my deep neural network code. when I tried using the above commands in my code I am getting error stating Undefined function or variable 'sequenceInputLayer'. As I am not having indepth knowledge of LSTM I am unable to solve the error.
Could you please help me to solve it.
  1 件のコメント
Steven Lord
Steven Lord 2021 年 6 月 11 日
Please don't post comments responding to an answer as answers themselves. Post them as comments, like I did here.
You did not mention in your original message that you were receiving an error.
Do you have Deep Learning Toolbox installed? You can check the output of the ver function to determine this. Since sequenceInputLayer is part of that product if you don't have the toolbox installed and licensed you will not be able to use it.
which sequenceInputLayer
/MATLAB/toolbox/nnet/cnn/sequenceInputLayer.m
Which release of MATLAB are you using? The ver function will also show you this.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by