I had 192 inputs with 48 outputs to train my network. To give a clear idea about the problem I have given the code with only four inputs and two outputs for an example.

When I try to train the network with only one element for each input and output, and three hidden neurons, network does not train. Even when I try to read the weight and bias (getwb(net)) of the trained network, it gives 3 zeros (3 is vary with the number of neurons, when it has 10 hidden neurons, getwb(net) gives 10 zeros) even though it should be equal to 23 weights and bias ((I+1)*H+(H+1)*O).

Most importantly, when I test the trained network, it gives my training target as the output with any testing input. But it shows the correct amount of weights and bias when I have more than one element for each input and target. But testing output is almost same with the last target set.

How can this happen? why it shows me only 3 weight, bias values (those are also zeros), at least where is my initial weights and bias? why it is equal to last target set when I have several elements for training inputs and targets. One thing I noticed "view(net)" shows I have 0 output layers (network diagram has been attached with this)

i = [1,2,3,4]; % 4 inputs with one element each

t = [1,2]; % 2 targets with one element each

net = feedforwardnet([3], 'trainlm'); %feedforward network with 3 hidden neurons net.layers{1}.transferFcn = 'tansig';

net.performFcn = 'mse'; net.trainParam.epochs = 100;

net.divideFcn = '';

[net, tr] = train(net, i', t'); %train the network

ut = sim(net, [[1,3,3,4]]') %testing the output

Similar questions and discussions