Number of inputs does not match net.numInputs. Custom-made net problem.

2 visualizaciones (últimos 30 días)
Hello,
I am composing my own custom net for use in a school project.
I am currenly basing my code off an example in the MATLAB documentation and I was able to get that documentation code to work.
However I am now trying to read in my own data from an excel sheet and run the net using this data, and this is where I run into the error.
The data reads into correctly, however the error reads "Number of inputs does not match net.numInputs."
I put in some debugging code so see the size of my inputs and the result is below. 2019-04-17 14_03_55-MATLAB R2018b.png
The input is clearly an array of 3x21135.
In my code I have defined the input as 3 as shown below.
Any help would be apprciated.
net = network;
net.numInputs = 3;
net.numLayers = 3;
net.biasConnect(1) = 1;
net.biasConnect(3) = 1;
net.inputConnect(1,1) = 1;
net.inputConnect(2,1) = 1;
net.inputConnect(2,2) = 1;
net.inputConnect(3,1) = 1;
net.inputConnect(2,3) = 1;
net.inputConnect(3,3) = 1;
net.layerConnect = [0 0 0; 0 0 0; 1 1 1];
net.outputConnect = [0 1 1];
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.layers{1}.size = 4;
net.layers{1}.transferFcn = 'tansig';
net.layers{1}.initFcn = 'initnw';
net.layers{2}.size = 3;
net.layers{2}.transferFcn = 'logsig';
net.layers{2}.initFcn = 'initnw';
net.layers{3}.initFcn = 'initnw';
net.inputWeights{2,1}.delays = [0 1];
net.inputWeights{2,2}.delays = 1;
net.layerWeights{3,3}.delays = 1;
net.initFcn = 'initlay';
net.performFcn = 'mse';
net.trainFcn = 'trainlm';
net.divideFcn = 'dividerand';
net.plotFcns = {'plotperform','plottrainstate'};

Respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by