MATLAB Answers

LSTM Sequence to One Regression

71 ビュー (過去 30 日間)
juan pedrosa
juan pedrosa 2019 年 10 月 26 日
コメント済み: Michael Hesse 2021 年 5 月 11 日 7:11
I'm trying to train a LSTM network for Sequence to one regression, but I'm having problems with my dataset, although I'm using the definition given by Mathworks here
My train set is a N by 1 cell array where N=2,396,493 and each sequence is an 8 by 22 double.
My response set is a N by R matrix where N=2,396,493 and R = 8
I'm using a mini batch size of 300 and when I try to train the network this is the error output:
Error using trainNetwork (line 165)
Unable to perform assignment because the size of the left side is 8-by-300 and the size of the right side is 1-by-300.
I've tried different setups for the response set by transposing it or make it an N by 1 cell array to no results. I did trained a Sequence to sequence network but I think I'll get better results with a Sequence to one network, any advices please?
[EDIT]
It seems that the minibatch size is the problem (bug?), if the minibatch size is set to 1 then the training begins without issues.
Thank you for your time.
  1 件のコメント
juan pedrosa
juan pedrosa 2020 年 9 月 17 日
it has been almost a year and the error still prevails, I've lost hope in matlab, I'm moving to tensorflow.

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

回答 (2 件)

shubhan vaishnav
shubhan vaishnav 2021 年 2 月 11 日
send the code
  1 件のコメント
juan pedrosa
juan pedrosa 2021 年 2 月 11 日
No need thank you! Tensorflow is awesome!

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


Josephine Morgenroth
Josephine Morgenroth 2021 年 4 月 19 日 15:36
I'm having the same issue - trying to the use sequence-to-one framework using OutpuMode = '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. The code runs fine, but the LSTM predicts the same value for all the sequences! Has anyone seen an example where this structure was successfully used in MATLAB?
  1 件のコメント
Michael Hesse
Michael Hesse 2021 年 5 月 11 日 7:11
hi josephine, i'm working on the same problem. in the last couple days i figured out that the
padding option does have a huge impact on the training and prediction performance.
in particular for my case: the setting 'SequencePaddingDirection', 'left', ... has brought the breakthrough.
hope it helps, michael

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

Community Treasure Hunt

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

Start Hunting!

Translated by