《BP神经网络测试例子(附数据)(共5页).doc》由会员分享,可在线阅读,更多相关《BP神经网络测试例子(附数据)(共5页).doc(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上Train.txt5.0,3.0,1.6,0.2,15.0,3.4,1.6,0.4,15.2,3.5,1.5,0.2,15.2,3.4,1.4,0.2,14.7,3.2,1.6,0.2,14.8,3.1,1.6,0.2,15.4,3.4,1.5,0.4,15.2,4.1,1.5,0.1,15.5,4.2,1.4,0.2,14.9,3.1,1.5,0.1,15.0,3.2,1.2,0.2,15.5,3.5,1.3,0.2,14.9,3.1,1.5,0.1,14.4,3.0,1.3,0.2,15.1,3.4,1.5,0.2,15.0,3.5,1.3,0.3,14.5,2.
2、3,1.3,0.3,14.4,3.2,1.3,0.2,15.0,3.5,1.6,0.6,15.1,3.8,1.9,0.4,14.8,3.0,1.4,0.3,15.1,3.8,1.6,0.2,14.6,3.2,1.4,0.2,15.3,3.7,1.5,0.2,15.0,3.3,1.4,0.2,16.6,3.0,4.4,1.4,26.8,2.8,4.8,1.4,26.7,3.0,5.0,1.7,26.0,2.9,4.5,1.5,25.7,2.6,3.5,1.0,25.5,2.4,3.8,1.1,25.5,2.4,3.7,1.0,25.8,2.7,3.9,1.2,26.0,2.7,5.1,1.6,2
3、5.4,3.0,4.5,1.5,26.0,3.4,4.5,1.6,26.7,3.1,4.7,1.5,26.3,2.3,4.4,1.3,25.6,3.0,4.1,1.3,25.5,2.5,4.0,1.3,25.5,2.6,4.4,1.2,26.1,3.0,4.6,1.4,25.8,2.6,4.0,1.2,25.0,2.3,3.3,1.0,25.6,2.7,4.2,1.3,25.7,3.0,4.2,1.2,25.7,2.9,4.2,1.3,26.2,2.9,4.3,1.3,25.1,2.5,3.0,1.1,25.7,2.8,4.1,1.3,27.2,3.2,6.0,1.8,36.2,2.8,4.8
4、,1.8,36.1,3.0,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.4,1.4,25.6,3.0,4.5,1.5,25.8,2.7,4.1,1.0,26.2,2.2,4.5,1.5,25.6,2.5,3.9,1.1,25.9,3.2,4.8,1.8,26.1,2.8,4.0,1
8、.3,26.3,2.5,4.9,1.5,26.1,2.8,4.7,1.2,26.4,2.9,4.3,1.3,26.3,3.3,6.0,2.5,35.8,2.7,5.1,1.9,37.1,3.0,5.9,2.1,36.3,2.9,5.6,1.8,36.5,3.0,5.8,2.2,37.6,3.0,6.6,2.1,34.9,2.5,4.5,1.7,37.3,2.9,6.3,1.8,36.7,2.5,5.8,1.8,37.2,3.6,6.1,2.5,36.5,3.2,5.1,2.0,36.4,2.7,5.3,1.9,36.8,3.0,5.5,2.1,35.7,2.5,5.0,2.0,35.8,2.8
9、,5.1,2.4,36.4,3.2,5.3,2.3,36.5,3.0,5.5,1.8,37.7,3.8,6.7,2.2,37.7,2.6,6.9,2.3,36.0,2.2,5.0,1.5,36.9,3.2,5.7,2.3,35.6,2.8,4.9,2.0,37.7,2.8,6.7,2.0,36.3,2.7,4.9,1.8,36.7,3.3,5.7,2.1,3close all;clear;clc;%读取训练数据f1,f2,f3,f4,class = textread(train.txt , %f%f%f%f%d,75,delimiter,); %特征值归一化input,minI,maxI =
10、premnmx( f1 , f2 , f3 , f4 ) ; %构造输出矩阵s = length( class) ;output = zeros( s , 3 ) ;for i = 1 : s output( i , class( i ) ) = 1 ;end %创建神经网络net = newff( minmax(input) , 10 3 , logsig purelin , traingdx ) ; %设置训练参数net.trainparam.show = 50 ;net.trainparam.epochs = 500 ;net.trainparam.goal = 0.01 ;net.tr
11、ainParam.lr = 0.01 ; %开始训练net = train( net, input , output ) ; %读取测试数据t1 t2 t3 t4 c = textread(test.txt , %f%f%f%f%d,75,delimiter,); %测试数据归一化testInput = tramnmx ( t1,t2,t3,t4 , minI, maxI ) ; %仿真Y = sim( net , testInput ) %统计识别正确率s1 , s2 = size( Y ) ;hitNum = 0 ;for i = 1 : s2 m , Index = max( Y( : , i ) ) ; if( Index = c(i) ) hitNum = hitNum + 1 ; endendsprintf(识别率是 %3.3f%,100 * hitNum / s2 )专心-专注-专业