Further reading on RNN suggests that a good solution would be to reset the network state after training on each sequence. But it is not clear how to do this with narxnet...is this something that can be done?
Formatting input and target data for narxnet as concurrent sequences
조회 수: 10 (최근 30일)
이전 댓글 표시
I am using narxnet to train on and predict time series data. My input is NxT, output is MxT, where T=number of time points. My time series are collected in individual trials of different lengths, so according to the doc on multiple sequences with dynamic neural network, I am combining my trial data into concurrent set of sequences, while at the same padding the shorter sequences.
This gives me the input Xnf as a Tx1 cell array, where T=number of time points in the longest trial. Each of these cells is an NxK matrix, N=dimension of input vector, K=number of trials. If trial k is length t1, then in all cells Xnf(t1+1:end), the k-th column will all be nan.
However, I want to divide my data into train, validation, and test with individual trials as units. For example, trials {1,5,6,7,8} are for training, trials {2,3,4} are for validation, and trials {9,10,11} are for testing.
I can't use any of the divdeFcn schemes to do that with my input format.
I then formatted my input such that XnF(1:i1) correspond to training, XnF((i1+1):i2) correspond to validation, and XnF((i2+1):end) correspond to test.
However, the number of columns in each cell within XnF(1:i1) is equal to the number of trials for training; the number of columns in each cell within XnF((i1+1):i2) is equal to the number of trials for validation. This way I can use use
net.divideFcn='divideind';
net.divideParam.trainInd=1:i1;
net.divideParam.valInd=(i1+1):i2;
net.divideParam.testInd=(i2+1):length(XnF)
However, this does not work and I get the following error from train:
Error using nntraining.setup>setupPerWorker (line 61)
Inputs X{1,1892} and Inputs X{1,1} have different numbers of columns.
This suggest to me all of the inputs need to have the same number of columns, so my input format does not work. How should I format my unequal-length trials of time series for narxnet?
댓글 수: 2
Greg Heath
2018년 4월 4일
I've reread this multiple times and still don't understand what you are doing and why. Are you able to get someone to edit or cowrite?
답변 (1개)
Allen Yin
2018년 4월 4일
댓글 수: 2
Greg Heath
2018년 4월 5일
편집: Greg Heath
2018년 4월 5일
You have erroneously put your comment into an answer box.
However, your comment does describe the correct procedure.
Good Luck
Greg
christttttttophe
2020년 2월 17일
Hey Allen, did you ever work this out? If so can you explain how?
I am just not sure how to do multiple 'trials' at the same time in Matlab. Especially because of the unequal length of the trials which seems to really make a difficulty with this.
Best.
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!