LSTM Input and Output Dimension Problem
Afficher commentaires plus anciens
I have a univariate time series for forecasting using LSTM and I split it into 9600 samples for training. For each training sample, the input is a sequence of 20 datapoints, and the output is the next datapoint in time (i.e., using the previous 20 datapoints to predict the next point in time).
My LSTM setup code is like this:
numChannels = 1;
numResponses = 1;
numHiddenUnits = 128;
layers = [
sequenceInputLayer(numChannels)
lstmLayer(numHiddenUnits)
fullyConnectedLayer(numResponses)
];
However, MATLAB gives an error saying
Size of predictions and targets must match.
Size of predictions:
1(C) × 128(B) × 20(T)
Size of targets:
1(C) × 128(B) × 1(T)
Then I am not sure how to shape my samples in a way allowed by MATLAB?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur AI for Signals dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!