2015-02-06 54 views
-1
m1= xlsread('NSL_KDD_TRAIN.xlsx','A2:AO67344'); % m1=input 
m= xlsread('NSL_KDD_TRAIN.xlsx','AP2:AP67344'); % m=output 

net=newff(m1',m',8); 
net=train(net,m1',m'); 
y=sim(net,m1'); %training data output 
y3=round(y); % making nonfraction number 

n1= xlsread('NSL_KDD_TRAIN.xlsx','A67345:AO79000'); % n1=input 
n= xlsread('NSL_KDD_TRAIN.xlsx','AP67345:AP79000'); % n=output 

net=newff(n1',n',8); 
net=train(net,n1',n'); 
y1=sim(net,n1'); %training data output 
y31=round(y1); 

我想使用前馈神经网络的输出作为训练另一种相同种类的神经网络的输入。我怎么能使用内置函数?,从上面的代码我需要培训一个新的newff其中我的输入参数将是y3y31。在m1n1 a有41列,我需要在新网络中的所有41列存在。我如何使用内置函数来做到这一点?如何在Matlab中实现多层神经网络?

回答

0

如果您认为架构相同,为什么不使用两层并只训练一个网络?

net = newff(input,target,[Layer_1 Layer_2],{'tansig' 'tansig' 'tansig'}); 

,你想,你可以尽可能多的指定Layer_1和Layer_2的大小,以及你可以改变各个层之间的激活功能。

Tutorial to create custom network from Mathworks

希望这将有助于