C-RNN regression error (Array inputs have incompatible channel dimensions)
Show older comments
Hi.
I am writing a C-RNN regression learning code. The loaded "paddedData2.mat" file is saved as paddedData, and it is stored as an N X 3 cell, as shown in the attached image. The input matrix used for training is the 3rd column of paddedData, which is [440 5] double, and the regression variable is the values in the 1st column. With this, I plan to create features of size [436 1] using two [3 3] kernels of convolution and train them using LSTM. The code is as follows. When running this code, the training window pops up, and at the same time, an error message "Array inputs have incompatible channel dimensions." occurs. Is there a solution?
clc;
clear all;
load("paddedData2.mat","-mat")
XTrain = paddedData(:,3);
YTrain1 = cell2mat(paddedData(:,1));
layers = [
sequenceInputLayer([440 5 1])
convolution2dLayer(3,8)
batchNormalizationLayer
reluLayer
convolution2dLayer(3,8)
batchNormalizationLayer
reluLayer
flattenLayer
fullyConnectedLayer(100)
lstmLayer(100,'OutputMode','last')
fullyConnectedLayer(1)
regressionLayer];
options = trainingOptions('adam', ...
'MaxEpochs',2000, ...
'MiniBatchSize',100, ...
'Plots','training-progress');
net = trainNetwork(XTrain, YTrain1, layers, options);

Accepted Answer
More Answers (0)
Categories
Find more on Define Shallow Neural Network Architectures 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!