神经网络基本算法源程序BF,ART I,RBF_光环大数据人工智能培训

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

光环大数据--大数据培训&人工智能培训神经网络基本算法源程序BF,ARTI,RBF_光环大数据人工智能培训光环大数据作为国内知名的人工智能培训的机构,帮助无数学员稳健、扎实的提升人工智能技术,来光环大数据学人工智能,高薪就业不是梦!//pittnet.CPP//Backpropagation/ART1/Kohonen/RadialBasis//Thepurposeofthisprototypeistoallowtheusertoconstructand//initializeaseriesofneuralnets.Usingtheconceptofinheritanceand//derivedclassesfromC++objectorientedprogramming,theneceessityto//declaremultiplelargestructuresthatduplicateattributesiseliminated//Utilizingpointersandthenewfunction,dynamicarraysareestablished//Theusercanthenspecifythestoragearraysizeforthenumberofhidden//unitsandoutputunitsfortheneuralnetworkwhiletheprogramisrunning.//Thisstrategyeliminatestheneedtoestablishextremelylargearrays//whilestillmaintainingtheflexibilityrequiredtodesignnetsofvarious.//shapesandsizes.TheNeuralclassesallowstheattributesofthenewly光环大数据--大数据培训&人工智能培训(1.0/IM)#defineIQ127773#defineIR2836#defineNTAB32#defineNDIV(1+(IM-1)/NTAB)#defineEPS1.2e-7#defineRNMX(1.0-EPS)//Thefollowingfunctionisarandomnumbergeneratorfloatbedlam(long*idum);intgaset=-2500;floatbedlam(long*idum)光环大数据--大数据培训&人工智能培训{intxj;longxk;staticlongiy=0;staticlongiv[NTAB];floattemp;if(*idum=0||!iy){if(-(*idum)1){*idum=1+*idum;}else{*idum=-(*idum);}for(xj=NTAB+7;xj=0;xj--){xk=(*idum)/IQ;*idum=IA*(*idum-xk*IQ)-IR*xk;if(*idum0){*idum+=IM;}if(xjNTAB){iv[xj]=*idum;光环大数据--大数据培训&人工智能培训}}iy=iv[0];}xk=(*idum)/IQ;*idum=IA*(*idum-xk*IQ)-IR*xk;if(*idum0){*idum+=IM;}xj=iy/NDIV;iy=iv[xj];iv[xj]=*idum;if((temp=AM*iy)RNMX){return(RNMX);}else{return(temp);}}//endofbedlamfunction//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%光环大数据--大数据培训&人工智能培训(Fullyconnectednetworkusingbackpropagation)//Inthisbaseclass,allnodesinthenetworkhavethefollowingattributesclassProcessing_units{public:float*processing_unit_input;intnumber_of_input_units;voidestablish_array_of_processing_unit_inputs(void);float*weight_of_inputs;voidestablish_weight_vector_for_processing_units(void);floatbias;floatoutput_signal;voidcalculate_output_signal(intactivation_function);floatcalculate_output_signal_derivative(intafun);floaterror_information_term;voidcalculate_weight_and_bias_correction_terms(floatlearning_rate);float*weight_correction_term;floatbias_correction_term;floatsum_of_weighted_inputs;voidupdate_weights_and_biases(void);Processing_units();~Processing_units();光环大数据--大数据培训&人工智能培训};Processing_units::Processing_units(){bias=0.0;output_signal=0.0;error_information_term=0.0;bias_correction_term=0.0;sum_of_weighted_inputs=0.0;}Processing_units::~Processing_units(){delete[]processing_unit_input;delete[]weight_of_inputs;delete[]weight_correction_term;}//DefinebaseclassmemberfunctionsvoidProcessing_units::establish_array_of_processing_unit_inputs(void){processing_unit_input=newfloat[number_of_input_units];weight_of_inputs=newfloat[number_of_input_units];weight_correction_term=newfloat[number_of_input_units];}光环大数据--大数据培训&人工智能培训::establish_weight_vector_for_processing_units(void){for(inti=0;inumber_of_input_units;i++){//weightsrangefrom1to-1weight_of_inputs[i]=1.0-(2.0*bedlam((long*)(gaset)));}}voidProcessing_units::calculate_output_signal(intactivation_function){sum_of_weighted_inputs=0.0;for(inti=0;inumber_of_input_units;i++){if(i==number_of_input_units-1){sum_of_weighted_inputs+=(processing_unit_input[i]*weight_of_inputs[i])+bias;}else{sum_of_weighted_inputs+=processing_unit_input[i]*weight_of_inputs[i];}}switch(activation_function){case1://binarysigmoidfunctionoutput_signal=1.0/(1.0+exp(-1.0*sum_of_weighted_inputs));光环大数据--大数据培训&人工智能培训://bipolarsigmoidfunctionoutput_signal=(2.0/(1.0+exp(-1.0*sum_of_weighted_inputs)))-1;break;}}floatProcessing_units::calculate_output_signal_derivative(intafun){floatderivative;switch(afun)//derivativeusedbasedonactivationfunctionseleted{case1://binarysigmoidfunctionderivative=output_signal*(1.0-output_signal);break;case2://bipolarsigmoidfunctionderivative=0.5*(1.0+output_signal)*(1.0-output_signal);break;}returnderivative;}void光环大数据--大数据培训&人工智能培训::calculate_weight_and_bias_correction_terms(floatlearning_rate){for(inti=0;inumber_of_input_units;i++){weight_correction_term[i]=learning_rate*error_information_term*pro

1 / 40
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功