How do I do a modular neural network ?

3 views (last 30 days)
dennis
dennis on 10 Sep 2014
Commented: Image Analyst on 10 Sep 2014
Hi my friend.
I'm trying to create a modular network; I train first several individual networks, but the last network need add a vector of output and I'm not how to do that. In Matlab ann are predefined network architectures.
My code is
%long is the longitude trained %regional is a vector data %sizemodule is the number of modules for module=1:1:sizemodule;
input(1:long)=regional(1:long,sizemodule);input=input';
s11(1:long)=estp(1:long);
target(1:long,1)= [s11'];
input=con2seq(input');target=con2seq(target');
capa=[10 5];
net = narnet(1:2,capa);
%net = distdelaynet({1:4 1:2},capa);
%net.trainFcn = 'trainbr';
net.trainFcn = 'trainlm';
net = initlay(net)
net.divideFcn = '';
%net.biasConnect = [0;0];
net.trainParam.epochs = 1000;
net.trainParam.max_fail=100;
net.layers{1}.transferFcn = 'logsig'; %net.layers{2}.transferFcn = 'logsig';
net.trainParam.goal=.00001; %Performance goal
% net.trainParam.min_grad=0; %Minimum performance gradient
%net.trainParam.mu_max=10e100; net.trainParam.max_fail=800;
net = train(net,input,target);
simulation(:,columna)=cell2mat(sim(net,input))';
clear input;input=regional(:,sizemodule);input=con2seq(input');valueresult(:,sizemodule)=cell2mat(sim(net,input))'; end
valueresult = mapminmax('reverse',mean(valueresult'),pnr1)';

Answers (0)

Community Treasure Hunt

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

Start Hunting!