?? bp2.m
字號:
%bp2.m; 例4.2
%
P=[-3,2];T=[0.4,0.8];
net=newlind(P,T); %設(shè)計線性網(wǎng)絡(luò)
y=sim(net,P);
w1=net.iw{1,1},b1=net.b{1}
net=newcf(minmax(P),[1],{'tansig'}); %創(chuàng)建前向BP網(wǎng)絡(luò)
net.trainParam.epochs=50; %初始化訓(xùn)練次數(shù)
net.trainParam.goal=0.001; %初始化目標(biāo)誤差
net=train(net,P,T); %訓(xùn)練網(wǎng)絡(luò)
W=net.iw{1,1},
B=net.b{1}
Y=sim(net,P); %計算結(jié)果
pause
plot(P,T,'r:') %畫出目標(biāo)點
hold on
plot(P,Y) %畫輸入為橫軸、輸出為縱軸的曲線
plot(P,y,'c+')
hold off
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -