MATLAB: I tried to create a neural networks but what’s wrong

create neural network

This is the code i tried :
net = newff(P,T,S)
net = newff(P,T,S,TF,BTF,BLF,PF,IPF,OPF,DDF)
Description
newff(P,T,S) takes,
  • P – RxQ1 matrix of Q1 representative R-element input vectors.
  • T – SNxQ2 matrix of Q2 representative SN-element target vectors.
  • Si – Sizes of N-1 hidden layers, S1 to S(N-1), default = [].
(Output layer size SN is determined from T.) and returns an N layer feed-forward backprop network.
This a description that i found .So i follow the instructions to create a neural network with one hidden layer composed of 6 nodes .
trainInput=[1 0.4 0.2 0.7]
trainOutput=[0.8 ]
chrom=[0.5 0.6 0.8 0.6 0.7 0.9 0.8 0.4 0.5 0.9 0.9;
0.1 0.7 0.6 0.7 0.9 0.5 0.9 0.2 0.4 0.5 0.9];
X=chrom(1,:);
net=newff(minmax(trainInput'),trainOutput',6);
trainInput =
1.0000 0.4000 0.2000 0.7000
trainOutput =
0.8000
>> net.IW
ans =
[6x0 double]
[]
>> net.LW
ans =
[] []
[0x6 double] []
>> net.b
ans =
[6x1 double]
[0x1 double]
I didn't underdtand what does this notation means :
net.IW
ans =
[6x0 double]
[]
it seems there is no connection with input ,i entered 4 input why i just have 2 cell ?

Best Answer

One cell per layer, it appears to me.
You can view the contents by requesting net.b{1} and net.b{2}