Use of catsamples() to concatenate sequences for a neural network
Show older comments
I have developed a MIMO NARX network where I have multiple sequences (trials). Originally, I concatenated the data with one trial after the other to create "continuous" input and target time series. Because the data is not really continuous, I get a discontinuation between each concatenation. After some digging, I found these 2 links that talks about problem ( https://www.mathworks.com/help/nnet/ug/understanding-neural-network-toolbox-data-structures.html ) and the solution ( https://www.mathworks.com/help/nnet/ug/multiple-sequences-with-dynamic-neural-networks.html ). However I am having troubles implementing the catsamples() command based on how my data is setup.
For the inputs, I have a cell array of 3x30 where each column is a sequence of different length of [2X1] (2 inputs) and each row will be a different input series. I have different experimental conditions saved in 1 cell array but each will be tested separately as a single input series.
EMG =3×30 cell array
Columns 1 through 5
{1×134 cell} {1×137 cell} {1×133 cell} {1×134 cell} {1×136 cell}
{1×134 cell} {1×137 cell} {1×133 cell} {1×134 cell} {1×136 cell}
{1×134 cell} {1×137 cell} {1×133 cell} {1×134 cell} {1×136 cell}
Columns 6 through 10 ...
EMG{1, 1}{1, 1} = 1×134 cell array
Columns 1 through 5
[2×1 double] [2×1 double] [2×1 double] [2×1 double] [2×1 double]
Columns 6 through 10 ...
The output is just a 1x30 where each column is a sequence/trial and each cell has 2 target outputs.
Angle_Moment=1×30 cell array
Columns 1 through 5
{1×134 cell} {1×137 cell} {1×133 cell} {1×134 cell} {1×136 cell}
Columns 6 through 10 ...
Angle_Moment{1, 1}{1, 1} = 1×134 cell array
Columns 1 through 5
[2×1 double] [2×1 double] [2×1 double] [2×1 double] [2×1 double]
Columns 6 through 10 ...
All the examples I found of catsamples() have each sequence in a separate variables. How can I implement
x_mul = catsamples(x1,x2,x3,'pad');
but with all the sequences in one single cell array with 2 inputs/outputs? Should I set up my data differently? How?
Also, I am planning on dividing my data using
net.divideFcn ='divideblock';
with 70-20-10%. Does that means it will take the first 21 values of the {1x30}?
Please respond if you have insight in either of the 2 questions (catsamples or divideFcn).
Thank you,
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!