?? bp3.m
字號(hào):
%bp3;例4.3
%
P=[-6 -6.1 -4.1 -4 4 4.1 6 6.1];
T=[0.0 0.0 0.97 0.99 0.01 0.03 1 1];
net=newlind(P,T);
w1=net.iw{1,1} %線性網(wǎng)路的權(quán)值
b1=net.b{1} %線性網(wǎng)絡(luò)的偏差
y=sim(net,P);
%axis('equal')
net=newcf(minmax(P),[1],{'logsig'},'traingd'); %創(chuàng)建一層非線性網(wǎng)絡(luò)
net.trainParam.epochs=400; %初始化訓(xùn)練次數(shù)
net.trainParam.goal = 0.2297;
net=train(net,P,T); %訓(xùn)練網(wǎng)絡(luò)
w2=net.iw{1,1} %非線性網(wǎng)路的權(quán)值
b2=net.b{1} %非線性網(wǎng)絡(luò)的偏差
Y=sim(net,P);
pause
plot(P,T,'r+'); %畫輸入點(diǎn)
hold on
plot(P,y); %畫線性輸入輸出點(diǎn)的連線
plot(P,Y,'r:') %畫非線性輸入輸出點(diǎn)的連線
hold off
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -