欢迎来到天天文库
浏览记录
ID:35935669
大小:126.00 KB
页数:17页
时间:2019-04-25
《rbf核神经网络程序matlab程序》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、实用标准文案#include"RadialBasisNetwork.h"#include"Exception.h"#include"Matrix.h"#include"File.h"usingnamespacestd;namespaceannie{/**CreatesaRadialbasisfunctionnetwork.Alltheoutputswillhaveabias.*@paraminputsNumberofinputstakeninbythenetwork*@paramcentersNumberofc
2、entersthenetworkhas.Eachcenterwillbe*aninputs-dimensionalpoint*@paramoutputsThenumberofoutputsgivenbytheneuron.Allofthemwillhave*abias*/RadialBasisNetwork::RadialBasisNetwork(intinputs,intcenters,intoutputs,real(*CenterArray)[1024]):Network(inputs,outputs){i
3、nti,j;//externrealCenterArray[WORDNUM][inputs];centroid=newreal[inputs];///Layerofinput.EachmemberisanInputNeuron//InputLayer*_inputLayer;_inputLayer=newInputLayer(0,inputs);/**Numberofcentersinthenetwork.*Ifyouplantoextendthisclass,thentheonusofkeepingthisv
4、alue*consistentliesonyou*/_nCenters=centers;///Layerofcenters,eachmemberisaCenterNEuron_centerLayer=newLayer(1);for(i=0;i<_nCenters;i++){for(j=0;j5、nputs);CenterNeuron*c=newCenterNeuron(Layer::MAX_LAYER_SIZE*1+i,inputs,centroid);for(j=0;jconnect(&_inputLayer->getNeuron(j));}_centerLayer->addNeuron(c);}///Layerofoutput,eachmemberifaSimpleNeuron_outputLayer=newLayer(2);for(i=0;i6、+){SimpleNeuron*n=newSimpleNeuron(Layer::MAX_LAYER_SIZE*2+i,true);n->setActivationFunction(identity,didentity);for(j=0;jconnect(&_centerLayer->getNeuron(j));_outputLayer->addNeuron(n);}}///Copyconstructor,NOTYETIMPLEMENTEDRadialBasisNetwork::7、RadialBasisNetwork(RadialBasisNetwork&src):Network(src){inti,j,lbl;intinputs=src._inputLayer->getSize();intcenters=src._centerLayer->getSize();intoutputs=src._outputLayer->getSize();_inputLayer=newInputLayer(src._inputLayer->getLabel(),src._inputLayer->getSi8、ze());_nCenters=src._nCenters;lbl=src._centerLayer->getLabel();_centerLayer=newLayer(lbl);for(i=0;i
5、nputs);CenterNeuron*c=newCenterNeuron(Layer::MAX_LAYER_SIZE*1+i,inputs,centroid);for(j=0;jconnect(&_inputLayer->getNeuron(j));}_centerLayer->addNeuron(c);}///Layerofoutput,eachmemberifaSimpleNeuron_outputLayer=newLayer(2);for(i=0;i6、+){SimpleNeuron*n=newSimpleNeuron(Layer::MAX_LAYER_SIZE*2+i,true);n->setActivationFunction(identity,didentity);for(j=0;jconnect(&_centerLayer->getNeuron(j));_outputLayer->addNeuron(n);}}///Copyconstructor,NOTYETIMPLEMENTEDRadialBasisNetwork::7、RadialBasisNetwork(RadialBasisNetwork&src):Network(src){inti,j,lbl;intinputs=src._inputLayer->getSize();intcenters=src._centerLayer->getSize();intoutputs=src._outputLayer->getSize();_inputLayer=newInputLayer(src._inputLayer->getLabel(),src._inputLayer->getSi8、ze());_nCenters=src._nCenters;lbl=src._centerLayer->getLabel();_centerLayer=newLayer(lbl);for(i=0;i
6、+){SimpleNeuron*n=newSimpleNeuron(Layer::MAX_LAYER_SIZE*2+i,true);n->setActivationFunction(identity,didentity);for(j=0;jconnect(&_centerLayer->getNeuron(j));_outputLayer->addNeuron(n);}}///Copyconstructor,NOTYETIMPLEMENTEDRadialBasisNetwork::
7、RadialBasisNetwork(RadialBasisNetwork&src):Network(src){inti,j,lbl;intinputs=src._inputLayer->getSize();intcenters=src._centerLayer->getSize();intoutputs=src._outputLayer->getSize();_inputLayer=newInputLayer(src._inputLayer->getLabel(),src._inputLayer->getSi
8、ze());_nCenters=src._nCenters;lbl=src._centerLayer->getLabel();_centerLayer=newLayer(lbl);for(i=0;i
此文档下载收益归作者所有