xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 27KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-16
  • 語言: 其他
  • 標簽: 代碼??

資源簡介

BP神經網絡源代碼,壓縮包里面包括訓練代碼、測試代碼、采樣數據。

資源截圖

代碼片段和文件信息

close?all?
clear?all?
clc?
web?-browser?http://www.ilovematlab.cn/thread-220251-1-1.html
x=xlsread(‘training_data.xls‘[‘B2:G401‘]);?
y=xlsread(‘training_data.xls‘[‘I2:K401‘]);?
inputs?=?x‘;?
targets?=?y‘;

%?創建一個模式識別網絡(兩層BP網絡),同時給出中間層神經元的個數,這里使用20
hiddenlayerSize?=?20;
net?=?patternnet(hiddenlayerSize);

%?對數據進行預處理,這里使用了歸一化函數(一般不用修改)
%?For?a?list?of?all?processing?functions?type:?help?nnprocess
net.inputs{1}.processFcns?=?{‘removeconstantrows‘‘mapminmax‘};
net.outputs{2}.processFcns?=?{‘removeconstantrows‘‘mapminmax‘};


%?把訓練數據分成三部分,訓練網絡、驗證網絡、測試網絡
%?For?a?list?of?all?data?division?functions?type:?help?nndivide
net.divideFcn?=?‘dividerand‘;??%?Divide?data?randomly
net.divideMode?=?‘sample‘;??%?Divide?up?every?sample
net.divideParam.trainRatio?=?70/100;
net.divideParam.valRatio?=?15/100;
net.divideParam.testRatio?=?15/100;

%?訓練函數
%?For?a?list?of?all?training?functions?type:?help?nntrain
net.trainFcn?=?‘trainlm‘;??%?Levenberg-Marquardt

%?使用均方誤差來評估網絡
%?For?a?list?of?all?performance?functions?type:?help?nnperformance
net.performFcn?=?‘mse‘;??%?Mean?squared?error

%?畫圖函數
%?For?a?list?of?all?plot?functions?type:?help?nnplot
net.plotFcns?=?{‘plotperform‘‘plottrainstate‘‘ploterrhist‘?...
??‘plotregression‘?‘plotfit‘};


%?開始訓練網絡(包含了訓練和驗證的過程)
[nettr]?=?train(netinputstargets);

%?測試網絡
outputs?=?net(inputs);
errors?=?gsubtract(targetsoutputs);
performance?=?perform(nettargetsoutputs)

%?獲得訓練、驗證和測試的結果
trainTargets?=?targets?.*?tr.trainMask{1};
valTargets?=?targets??.*?tr.valMask{1};
testTargets?=?targets??.*?tr.testMask{1};
trainPerformance?=?perform(nettrainTargetsoutputs)
valPerformance?=?perform(netvalTargetsoutputs)
testPerformance?=?perform(nettestTargetsoutputs)

%?可以查看網絡的各個參數
view(net)

%?根據畫圖的結果,決定是否滿意
%?Uncomment?these?lines?to?enable?various?plots.
figure?plotperform(tr)
figure?plottrainstate(tr)
figure?plotconfusion(targetsoutputs)
figure?ploterrhist(errors)


%如果你對該次訓練滿意,可以保存訓練好網絡
save(‘training_net.mat‘‘net‘‘tr‘);


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-03-22?20:35??BP\
?????文件???????30369??2013-03-22?19:14??BP\training_data.xls
?????文件????????2238??2013-03-22?19:09??BP\Training_NPR.m
?????文件?????????600??2013-03-22?19:10??BP\Use_For_Predict.m

評論

共有 條評論