

net=network; % Create a custom neural network

net.numInputs  = 2;             %%% 2 onafhankelijke inputs
net.numLayers = 2;              %%% 1 hidden layers + output unit

net.biasConnect = [1; 0];      %%% all layers have bias
net.inputConnect = [1 0; 0 1];  %%% connect the 1th input with the 1th hidden layer
                                %%% connect the 2th input with the 2th hidden layer
                                                    
net.layerConnect = [0 0; 1 0];  %%% Connect output   with  hidden layer

net.outputConnect = [0  1];     %%% Connect  2nd layer to network output
                                                    
%%net.targetConnect = [0  1];     %%% give only Output layer a Target


%input_range=minmax(pn');
%output_range=minmax(tn');

net.inputs{1}.size=2*30%2*Nfreq %%%size 1st input:cochlea 2*Nfreq
%net.inputs{1}.range=[  input_range(1,:) ;  input_range(2,:)];
       
net.inputs{2}.size=2*10%2*Nmsc %%%size 2st input: eyepos 2*Nmsc
%net.inputs{2}.range=[  input_range(3,:) ];

net.layers{1}.dimensions=4%Naud;  %%%%% NUMBER OF UNITS FIRST HIDDEN LAYER
net.layers{1}.initFcn = 'initnw';
net.layers{1}.transferFcn = 'tansig';

%%%net.layers{2}.dimensions=2;
net.layers{2}.dimensions=20%Nhidden;
net.layers{2}.initFcn = 'initnw';
net.layers{2}.transferFcn = 'purelin';

%%%%%net.outputs{1,2}.size=20

net.adaptFcn= 'trains';
net.initFcn='initlay';
net.performFcn= 'mse';
net.trainFcn= 'trainbr';
%%net.trainFcn= 'trainlm';
% net.trainParam.epochs = 5000;
% randn('seed',192736547);
% net = init(net);

% net.inputs{1}.size=2*30%2*Nfreq 
%        
% net.inputs{2}.size=2*10%2*Nmsc 




IW1=net.IW{1,1};

IW2=net.IW{2,2};

LW=net.LW{2,1};


size(IW1)
size(IW2)
size(LW)
