- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
分享BP神经网络VC源代码.doc
[分享]BP神经网络VC源代码 #include conio.h #include math.h #include stdlib.h #include stdio.h #define Beta 1.0 #define NAME_MAX 80 double bp(w_ih,w_ho,patt,targ,nn,hh,pp,mm,fin,fileW, resultF,crition,total,sa); double **w_ih;/* weight from input to hidden */ double **w_ho;/* weight from hidden to output */ double **patt;/* input patterns */ double **targ;/* desired outputs */ intnn;/* input dim */ int hh;/* hidden dim */ int pp;/* output dim */ int mm;/* training patterns number */ int*fin;/* flag for terminate */ char*fileW;/* weightFile */ char*resultF;/* resultFile Name */ doublecrition;/* minimum mean square */ int total; int sa;/* flag for saving weights */ { double *output; int i,j,s,num_p,num_d,mis,mis_tr,mis_te; double err; char Msg[NAME_MAX],Msg1[NAME_MAX],Msg2[NAME_MAX], Msg3[NAME_MAX],Msg4[NAME_MAX],Msg5[NAME_MAX]; FILE *fp; FILE *cor; extern int maximum(double *,int); //extern void drawbp(double **,double **,int,int,int); void feedward(double **,double **,double *,double *,int,int,int); double errSqu(double *,double *,int); output=(double *)calloc(pp,sizeof(double)); err=0.0; for (i=0;imm;i++) { feedward(w_ih,w_ho,patt,output,nn,hh,pp); err +=errSqu(output,targ,pp); } /* err=sqrt(err/(pp*mm)); mean-square-root */ err=err/(pp*mm); /* mean-square */ if ((err=crition)||(sa==1)) { /* draw bp */ //drawbp(w_ih,w_ho,nn,hh,pp); if (err=crition) *fin=1; if ((fp=fopen(fileW,wt))==NULL) { fprintf(stderr,cannot open %s file for writing\n,fileW); exit(1); } sprintf(Msg,weight from input to hidden); fprintf(fp,%s\n,Msg); for (j=0;jhh;j++) { for (s=0;s(nn+1);s++) fprintf(fp,%f\t,w_ih[j][s]); fprintf(fp,\n); } sprintf(Msg,weight from hidden to output); fprintf(fp,%s\n,Msg); for (j=0;jpp;j++) { for (s=0;s(hh+1);s++) fprintf(fp,%f\t,w_ho[j][s]); fprintf(fp,\n); } fclose(fp); if ((cor=fopen(resultF,wt))==NULL) { fprintf(stderr,cannot open %s for writing\n,resultF); exit(1); } sprintf(Msg,Index); sprintf
您可能关注的文档
- 写以下文章的前言简介及分析结论。.doc
- 写信询问类雅思写作范文解析(移民类).doc
- 军事相关英语词汇().doc
- 农业产业化上海市重点龙头企业.doc
- 农业产业化类项目一.doc
- 农业产业化类项目().doc
- 农业保险对农民、国家的福利影响及实证研究.doc
- 农业信息化、.doc
- 农业园区环山机耕路建设工程.doc
- 农业国际合作发展“十二五”规划.doc
- 考点攻克人教版八年级上册物理《机械运动》专题训练试题(含解析).docx
- 考点攻克人教版八年级上册物理《声现象》综合练习试题(详解版).docx
- 考点攻克人教版八年级上册物理《声现象》综合训练练习题(含答案解析).docx
- 考点攻克人教版八年级上册物理《声现象》综合训练练习题.docx
- 统编版(2024)新教材七年级语文上册第二单元第5课《秋天的怀念》反复出现的句子(教学设计).docx
- 考点攻克人教版八年级上册物理《声现象》综合练习试题(含详细解析).docx
- 考点攻克人教版八年级上册物理《声现象》综合练习试题(含详解).docx
- 2025年新能源行业上市公司市值增长驱动因素与市场格局研究报告.docx
- 考点攻克人教版八年级上册物理《声现象》综合训练试卷.docx
- 考点攻克人教版八年级上册物理《声现象》综合练习试题(含解析).docx
文档评论(0)