I have an EEG with 16 chanel. It is organized in a table using TabularTextDatastore. 16 columns, one per chanel. I want to organize the data in minibatchs 500x16 datapoints. Each datapoint count for a signal mesuments at 1 sec interval.
ds[100000 X 16] -> minibatchqueue -> [80000] -> model || [ch1ch2ch3...n] || [500 500 500 500 ...]
model has 500x16=80000 inputs in the feature layer
this is m minibacthqueue code:
mbq = minibatchqueue(ds, ...
MiniBatchSize=miniBatchSize, ...
PartialMiniBatch="discard", ...
MiniBatchFcn=@preprocessMiniBatch, ...
MiniBatchFormat="SSCB");
the preprocessMiniBatch function I can't figure out. How do I manipulate the date so it spits out 500 seconds of each channel to my model. The alternative is to to create 16 identical models that can process 1 chanel at a time.
I tried:
function X = preprocessMiniBatch(data)
% Concatenate mini-batch
X = data{1,1:500};
for idx = 2:16
X = cat(1,X,data{idx,1:500});
end
end
the ouput is this:
Error using minibatchqueue>iValidateMiniBatchFcn (line 778) Number of mini-batch variables (16) must be less than or equal to the number of outputs (1) of function specified by 'MiniBatchFcn'. Set number of mini-batch variables or modify the number of outputs of the function.
Error in minibatchqueue>iParseInputs (line 656) iValidateMiniBatchFcn(options.MiniBatchFcn, numVariables, options.NumOutputs);
Error in minibatchqueue (line 294) options = iParseInputs(numVariables, varargin{:});
Error in eegbtexp (line 66) mbq = minibatchqueue(ds, ...