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

3 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by