Why wrong using of RESHAPE when I do trainNetwork in LSTM?

4 ビュー (過去 30 日間)
Yiyan Huang
Yiyan Huang 2019 年 10 月 11 日
コメント済み: Param Raval 2019 年 11 月 9 日
I 've written python LSTM. However in the MATLAB I cannot realize it by using deep learning toolbox(deep network designer).
I have X_train(606300*4) Y_train(6063), which means every 100 time point with 4 features in the history matches a status Y.
Since LSTM can only input sequence not matix, I input 4 features individually.
I am not sure if data can be batched like python, so I choose batch_size as 100 and reshape my X_train to 100*4*6063 so the feature_u is 100*1*6063.
But when I trainNetwork there always exists RESHAPE error(wrong use in RESHAPE, if you want to RESHAPE, please do NOT modify the number of elements).
How should I fix this and train my model like python(train data with batches)?1570816010(1).jpg

回答 (1 件)

Jalaj Gambhir
Jalaj Gambhir 2019 年 10 月 16 日
編集済み: Jalaj Gambhir 2019 年 10 月 16 日
Hi,
You might want to convert your data to dlarray, and use dlarray batches for training LSTM's as mentioned here.
The number of elements in reshaped array and original array should remain same, hence the error with reshape in your case.
  4 件のコメント
Yiyan Huang
Yiyan Huang 2019 年 11 月 1 日
Have you ever tried installing the package including dlarray?
Param Raval
Param Raval 2019 年 11 月 9 日
No, I haven't. Which package is it? I already have the DL Toolbox.

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

カテゴリ

Help Center および File ExchangeCustom Training Loops についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by