Handle Multiple Sequences with GRU/LSTM Dynamic Neural Networks
조회 수: 6 (최근 30일)
이전 댓글 표시
I am performing system identification using neural networks. My data includes multiple subsets of data (experimental trials) rather than one long continuous dataset. Due to this, I can not simply concatenate the data to train a dynamic neural network since there will be discontinuities. I found this page which gets around this issue when designing a NARX network - https://www.mathworks.com/help/deeplearning/ug/multiple-sequences-with-dynamic-neural-networks.html
However, when I try to use this method with a LSTM or GRU design, i get the following error:
Error using DAGNetwork/predictRNN>iAssertInitialStateIsValidForPredict (line 69)
Incorrect network state. The network expects mini-batches size of 16, but was passed a mini-batch of size 1.
Error in DAGNetwork/predictRNN (line 11)
iAssertInitialStateIsValidForPredict(statefulLayers, dispatcher.MiniBatchSize)
Error in DAGNetwork/predictAndUpdateState (line 123)
[Y, finalState, predictNetwork] = this.predictRNN(X, dispatcher, ...
Error in SeriesNetwork/predictAndUpdateState (line 379)
[this.UnderlyingDAGNetwork, Y] = this.UnderlyingDAGNetwork.predictAndUpdateState(X, varargin{:});
Error in GRU_setup (line 327)
[updatedNet,yy] = predictAndUpdateState(updatedNet,v);
Note that the dimension of 16 is referring to the number of experimental trials used to train the network. I concatenated these trials using the catsamples function and got a 1x3600 cell array with each cell have a double array with dimensions 5x16. The number of inputs I have is 5 and the number of samples per test trial is 3600. Additionally, this is a single output system.
Why does the catsample method work for NARX networks but not for LSTM/GRU networks? What is a good way to organize my discontinuous data for training and execution of a LSTM/GRU network?
댓글 수: 2
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!