91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-01-04
  • 語言: Matlab
  • 標(biāo)簽: 函數(shù)擬合??

資源簡介

創(chuàng)建BP神經(jīng)網(wǎng)絡(luò),然后擬合二元一次函數(shù)圖像,并計(jì)算函數(shù)平均值、誤差等。

資源截圖

代碼片段和文件信息

clear;

%%定義樣本數(shù)據(jù)
x1=20*rand(1100)-10;
x2=20*rand(1100)-10;
x3=20*rand(1100)-10;
x4=20*rand(1100)-10;

%%劃分訓(xùn)練數(shù)據(jù)與測試數(shù)據(jù)
p?=?[x1;x2];
t?=?[x1+x2-4];
intest?=?[x3;x4];
outest?=?[x3+x4-4];

%%創(chuàng)建并訓(xùn)練網(wǎng)絡(luò)
net?=?newff(pt[16]);
net?=?train(netpt);
yy?=?sim(netintest);

%%輸出圖像
l1?=?linspace(-101050);
l2?=?linspace(-101050);
[X1X2]?=?meshgrid(l1l2);
P?=?[X1(:)‘;X2(:)‘];
Z?=?sim(netP);
Y?=?reshape(Z5050);
figure(1)
surf(X1X2Y);hold?on;
axis([-1010-1010min(Y(:))max(Y(:))]);
youtest?=?sim(netintest);
plot3(intest(1:)intest(2:)youtest‘b*‘)
xlabel(‘X1‘);
ylabel(‘X2‘);
zlabel(‘Y‘);
legend(‘?dāng)M合結(jié)果‘‘樣本點(diǎn)‘);
title(‘Y=X1+X2-4‘)
hold?off?

%%計(jì)算、顯示相對誤差等
e?=?(outest-yy)./outest;
figure(2);
plot(1:10

評論

共有 條評論

相關(guān)資源