?? demo_bp2.m
字號:
% nnd_bp2.m
% 8-3-8 Ecoder Problem
% Backprogation with adaptive learning rate
%
% Matlab Neural Network Toolbox 3.0
% O. Bittel, 1.3.1999
echo on
% Lernaufgabe
P = [1 0 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 0 1 0 0 0 0 0;
0 0 0 1 0 0 0 0;
0 0 0 0 1 0 0 0;
0 0 0 0 0 1 0 0;
0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 1];
T = [1 0 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 0 1 0 0 0 0 0;
0 0 0 1 0 0 0 0;
0 0 0 0 1 0 0 0;
0 0 0 0 0 1 0 0;
0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 1];
% Definition des Netzes:
f = 'logsig'; % Aktivierungsfunktion
net = newff(minmax(P),[3,8],{f,f}); % 8-3-8-Netz
net = init(net);
% Training
net.trainFcn = 'trainrp'; % Resilient Backpropagation
net.performFcn = 'sse'; % Performance-Fkt des Netzes ist sum squared error (sse)
net.trainParam.show = 10; % Display-Rate
net.trainParam.epochs = 2000; % Max Anz. Epochen
net.trainParam.goal = 0.05; % Fehlerziel: SSE = 0
net = train(net,P,T);
pause % Irgendeine Taste eingeben
clc;
% Netz anwenden:
O = sim(net,P);
P
T
hardlim(O-0.5) % Schwellenwertfunktion
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -