?? dcm3_nn.m
字號:
% Main_Program dcm3_nn.m.
% Find a NN to replace the FIS in [P T] described
% in Example 6.7-1
% Input pattern
P=P';
% Target
T=T';N=length(T);P=P(:,1:N);
% New Feedforward NN
net = newff([-1 1;-1 1],[2 1],{'tansig' 'purelin'});
net.trainParam.epochs = 500;
net.trainParam.goal = 1e-10;
% Training
net = train(net,P,T);
% Get the Neural output
Y = sim(net,P);
% Reprint the Target
T;
% Display weights and bias
W10=net.IW{1,1}
B10=net.b{1}
W20=net.LW{2,1}
B10=net.b{2}
% Plot the target and neural outputs
sample=1:length(T);
figure(3);plot(sample,T,sample,Y)
title('Desired and Neural output plots')
xlabel('Sample points');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -