資源簡介
用GUI設計神經網絡的matlab代碼--MATLAB神經網絡原理與實例精解

代碼片段和文件信息
%fit_test.m
%?Solve?an?Input-Output?Fitting?problem?with?a?Neural?Network
%?script?generated?by?NFTOOL
%?Created?Sun?Mar?11?15:31:43?CST?2012
%
%?This?script?assumes?these?variables?are?defined:
%
%???x?-?input?data.
%???y?-?target?data.
%?自定義語句------------------------------
x=0:.2:2*pi+.2;
rng(2);y=sin(x)+rand(1length(x))*0.5;
plot(xy‘o-‘);
%-----------------------------------------
inputs?=?x;
targets?=?y;
%?Create?a?Fitting?Network
hiddenlayerSize?=?10;
net?=?fitnet(hiddenlayerSize);
%?Setup?Division?of?Data?for?Training?Validation?Testing
net.divideParam.trainRatio?=?70/100;
net.divideParam.valRatio?=?15/100;
net.divideParam.testRatio?=?15/100;
%?Train?the?Network
[nettr]?=?train(netinputstargets);
%?Test?the?Network
outputs?=?net(inputs);
errors?=?gsubtract(targetsoutputs);
performance?=?perform(nettargetsoutputs)
%?View?the?Network
view(net)
%?自定義語句-----------------------------
xx=0:.1:2*pi+.2;
yy=sin(xx)+0.25;
yx=net(xx);
plot(xy‘o‘);
hold?on;
plot(xxyy‘g-‘);
plot(xxyx‘r+‘);
legend(‘訓練樣本‘‘正弦曲線出‘‘實際輸出‘);
%----------------------------------------
%?Plots
%?Uncomment?these?lines?to?enable?various?plots.
%figure?plotperform(tr)
%figure?plottrainstate(tr)
%figure?plotfit(netinputstargets)
%figure?plotregression(targetsoutputs)
%figure?ploterrhist(errors)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1393??2012-10-26?19:09??第11章?用GUI設計神經網絡\fit_test.m
?????文件???????1384??2012-10-26?19:18??第11章?用GUI設計神經網絡\pr_test.m
?????文件???????1465??2012-10-25?08:26??第11章?用GUI設計神經網絡\som_test.m
?????文件???????1059??2012-10-25?04:54??第11章?用GUI設計神經網絡\stock1.mat
?????目錄??????????0??2017-08-16?17:02??第11章?用GUI設計神經網絡
-----------?---------??----------?-----??----
?????????????????5301????????????????????5
- 上一篇:pHog紋理識別 matlab程序
- 下一篇:盒維數MATLAB計算程序
評論
共有 條評論