Formatting input and target data for narxnet as concurrent sequences
显示 更早的评论
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 个评论
Allen Yin
2018-4-3
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
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!