LSTM error with number of X and Y observations

1 回表示 (過去 30 日間)
Daniel Guo
Daniel Guo 2020 年 4 月 14 日
コメント済み: Daniel Guo 2020 年 4 月 14 日
I am using lstm regression network to denoise speech. The predictor input consists of 9 consecutive noisy STFT vectors. The target is corresponding clean STFT vector. The length of each vector is 129.
Here 's the network I defined:
layers = [
sequenceInputLayer([129 9 1],"Name","sequence")
flattenLayer("Name","flatten")
lstmLayer(128,"Name","lstm")
fullyConnectedLayer(129,"Name","fc_1")
reluLayer("Name","relu")
fullyConnectedLayer(129,"Name","fc_2")
regressionLayer("Name","regressionoutput")];
I trained the network with X and Y of sizes:
size(X):
129 9 1 254829
size(Y):
129 254829
I got the error "Invalid training data. X and Y must have the same number of observations". I think that maybe the network I defined is wrong. I am new with lstm network to do sequence-to-sequence regression. What should I do with my network or training data?
Thanks for your help!

採用された回答

jibrahim
jibrahim 2020 年 4 月 14 日
Hi Daniel,
Please refer to the help of trainNetwork for info on correct input sizes for sequences.
The inputs must be cell arrays. Here is an example with two observations:
opts = trainingOptions('adam');
trainNetwork({randn(129,9,1) , randn(129,9,1)}, {randn(129,1),randn(129,1)},layers,opts)
  1 件のコメント
Daniel Guo
Daniel Guo 2020 年 4 月 14 日
It works! Thank you a lot :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by