To correctly shape your data for a biLSTM network in MATLAB, ensure it follows the [sequenceLength, numFeatures, numObservations] format. Given your scenario with 18 sequences, 70,000 samples per sequence, and 3 sensors:
- sequenceLength: 70,000 (number of samples)
- numFeatures: 3 (number of sensors)
- numObservations: 18 (number of sequences)
If using cell arrays, each cell should be [sequenceLength x numFeatures], meaning each contains a [70000x3] matrix.
For the LSTM network, set the inputSize in sequenceInputLayer to the number of features (3 for three sensors). Do not treat the sequence length as the feature dimension. Training should be done on all sequences together, not one by one, to improve model performance.
bilstmLayer(100,'OutputMode','sequence')
options = trainingOptions('adam', ...
'Plots','training-progress');
net = trainNetwork(XTrain, YTrain, layers, options);
Ensure XTrain is correctly shaped or is a cell array where each cell is [70000x3].
Hope it helps!