LSTM sequence-to-one regression

13 ビュー (過去 30 日間)
Josephine Morgenroth
Josephine Morgenroth 2021 年 4 月 19 日
回答済み: Asvin Kumar 2021 年 5 月 11 日
I'm trying to the use sequence-to-one regression framework using OutputMode = 'last' with no success. I have a time series dataset with 10 features to predict 3 targets, with a total of 30 sequence/target rows. My training data is formatted such that XTrain is a {30x1} cell, where each cell is [10 x L] and L represents the varying sequence length. YTrain is [30 x 3], representing the three targets for each sequence.
The code runs fine, but the LSTM predicts YPred = [30 x 3] and each column has the same value for all 30 sequences! Is there some setting I'm missing, or can anyone point me to an example where this structure was successfully used in MATLAB?

回答 (1 件)

Asvin Kumar
Asvin Kumar 2021 年 5 月 11 日
If you could share the code that you've written so far, the community will be able to help you better.
If I still had to guess, I would say this is because YTrain is not a cell array of size 30x1 similar to XTrain. Each cell of YTrain would then have an array of size 3x1.
Also, ensure that the 'OutputMode' property is set to 'last'. You can set the 'NumHiddenUnits' to 3 or you can set it to a larger size as required and then follow up the lstmLayer with a fullyConnectedLayer whose outputSize is 3 similar to this example on Japanese vowel classification. The output size of the lstmLayer will be 'NumHiddenUnits' as mentioned here. This will be the input size to the fullyConnectedLayer.

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by