How to use trainNetwork with varying lengths of inputs and outputs?

8 ビュー (過去 30 日間)
Renita Raidoo
Renita Raidoo 2020 年 6 月 19 日
回答済み: Divya Gaddipati 2020 年 6 月 25 日
Hi all. I have a problem using trainNetwork for a seq-to-seq regression problem. The error it gives is "Sequence responses must have the same sequence length as the corresponding predictors". I have used a sliding window to take 5 previous timesteps (with multiple features concatenated into a cell) and predict a single feature 2 timesteps into the future. It works when I try to predict 5 timesteps into the future but won't work if the Y_Train cell has comma separated row vectors with any other number of entries within the cell. Is there some way to use the LSTM layers to do this type of forecasting? I hope the pictures of the data helps .

回答 (1 件)

Divya Gaddipati
Divya Gaddipati 2020 年 6 月 25 日
From the error, I'm guessing the size of the output from the last layer of your network is not same as the size of YTrain, which is causing the error. Modify the last layer to output responses of size(Ytrain).
For more information on defining networks for sequence-to-sequence regression type problems, you can refer to the following link:

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by