how to apply sliding window in deep learning LSTM using MATLAB Deep Learning Toolbox

45 Views Asked by At

i am currenty using MATLAB Deep Learning Toolbox to build a LSTM-Network to do timeseries regression. Since my data has 12 features and 1 response. The input size of the sequenceInputLayer is set to 12. However, i want to apply a sliding window to my data, which means the dimension of the input of the sequenceInputLayer should be a matrix. (if sliding window is 3,then the input should be [12x3] or [3x12] Matrix?) Is that possible and how to realize it? And also, how does Matlab know that the input data is time series?

I tried to create a input array consisting of 3 time steps. In this case the input of the sequence is 36. But it didn't help a lot.

numFeatures = 12
Layers = [ ...
    sequenceInputLayer(numFeatures)
    gruLayer(numHiddenUnits,'OutputMode','sequence')
    dropoutLayer(0.5)
    fullyConnectedLayer(64)
    dropoutLayer(0.5)
    fullyConnectedLayer(numResponses)
    regressionLayer];
0

There are 0 best solutions below