Why wrong using of RESHAPE when I do trainNetwork in LSTM?
Mostra commenti meno recenti
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)?.jpeg)
.jpeg)
Risposte (1)
Jalaj Gambhir
il 16 Ott 2019
Modificato: Jalaj Gambhir
il 16 Ott 2019
1 voto
4 Commenti
Yiyan Huang
il 22 Ott 2019
Param Raval
il 31 Ott 2019
Modificato: Param Raval
il 31 Ott 2019
Hello.
I tried this out but I'm getting a "undefined function dlarray" as an error. What can be the problem?
Note: I'm using trainNetwork() as well. And I've defined the "layers" part manually as per the Deep Learning Toolbox.
layers = [
sequenceInputLayer(1, "Name", "sequence")
fullyConnectedLayer(1,"Name","fc")
lstmLayer(128,"Name","lstm")
tanhLayer("Name", "tanh")
regressionLayer('Name', 'regressionoutput')];
options = trainingOptions('adam', 'MiniBatchSize', 100);
rng('default')
X_train = dlarray(X_train,'CBT');
X_test = dlarray(X_test,'CBT');
y_train = dlarray(y_train,'CBT');
y_test = dlarray(y_test,'CBT');
net = trainNetwork(X_train,y_train,lgraph, options);
Yiyan Huang
il 1 Nov 2019
Param Raval
il 9 Nov 2019
No, I haven't. Which package is it? I already have the DL Toolbox.
Categorie
Scopri di più su Built-In Training in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!