LSTM Input and Output Dimension Problem
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 AI for Signals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!