LSTM error with number of X and Y observations

1 visualizzazione (ultimi 30 giorni)
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!

Risposta accettata

jibrahim
jibrahim il 14 Apr 2020
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)

Più risposte (0)

Categorie

Scopri di più su Sequence and Numeric Feature Data Workflows in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by