资源描述:
《matlab神经网络及其应用》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MATLAB中的神经网络及其应用:以BP为例主讲:王茂芝副教授wangmz@cdut.edu.cn1一个预测问题已知:一组标准输入和输出数据(见附件)求解:预测另外一组输入对应的输出背景:略2BP网络3MATLAB中的newff命令NEWFFCreateafeed-forwardbackpropagationnetwork.Syntaxnet=newffnet=newff(PR,[S1S2...SNl],{TF1TF2...TFNl},BTF,BLF,PF)命令newff中的参数说明NET=NEWFFcre
2、atesanewnetworkwithadialogbox.NEWFF(PR,[S1S2...SNl],{TF1TF2...TFNl},BTF,BLF,PF)takes,PR-Rx2matrixofminandmaxvaluesforRinputelements.Si-Sizeofithlayer,forNllayers.TFi-Transferfunctionofithlayer,default='tansig'.BTF-Backpropnetworktrainingfunction,default='t
3、rainlm'.BLF-Backpropweight/biaslearningfunction,default='learngdm'.PF-Performancefunction,default='mse'.andreturnsanNlayerfeed-forwardbackpropnetwork.参数说明ThetransferfunctionsTFicanbeanydifferentiabletransferfunctionsuchasTANSIG,LOGSIG,orPURELIN.Thetraining
4、functionBTFcanbeanyofthebackproptrainingfunctionssuchasTRAINLM,TRAINBFG,TRAINRP,TRAINGD,etc.参数说明*WARNING*:TRAINLMisthedefaulttrainingfunctionbecauseitisveryfast,butitrequiresalotofmemorytorun.Ifyougetan"out-of-memory"errorwhentrainingtrydoingoneofthese:(1)
5、SlowTRAINLMtraining,butreducememoryrequirements,bysettingNET.trainParam.mem_reducto2ormore.(SeeHELPTRAINLM.)(2)UseTRAINBFG,whichisslowerbutmorememoryefficientthanTRAINLM.(3)UseTRAINRPwhichisslowerbutmorememoryefficientthanTRAINBFG.参数说明ThelearningfunctionBL
6、FcanbeeitherofthebackpropagationlearningfunctionssuchasLEARNGD,orLEARNGDM.TheperformancefunctioncanbeanyofthedifferentiableperformancefunctionssuchasMSEorMSEREG.4MATLAB中的train命令TRAINTrainaneuralnetwork.Syntax[net,tr,Y,E,Pf,Af]=train(NET,P,T,Pi,Ai,VV,TV)Des
7、criptionTRAINtrainsanetworkNETaccordingtoNET.trainFcnandNET.trainParam.输入参数说明TRAIN(NET,P,T,Pi,Ai)takes,NET-Network.P-Networkinputs.T-Networktargets,default=zeros.Pi-Initialinputdelayconditions,default=zeros.Ai-Initiallayerdelayconditions,default=zeros.VV-S
8、tructureofvalidationvectors,default=[].TV-Structureoftestvectors,default=[].输出参数说明andreturns,NET-Newnetwork.TR-Trainingrecord(epochandperf).Y-Networkoutputs.E-Networkerrors.Pf-Finalinputdelayconditions.Af-Fin