下载此文档

BP算法程序C语言实现.doc


文档分类:IT计算机 | 页数:约11页 举报非法文档有奖
1/11
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/11 下载此文档
文档列表 文档介绍
文件输入输出目录为: F:\BP\ 训练样本文件名: 值为: 11 -11 -110101 输出文件名为: ========================= #include "" #include "" #include "" #include "" #define N2 /*/ 学****样本个数*/ #define IN3 /*/ 输入层神经元数目*/ #define HN 3 /*/ 隐层神经元数目*/ #define ON 2 /*/ 输出层神经元数目*/ #define Z 20 /* 旧权值保存, 每次 study 的权值都保存下来*/ double P[IN]; /* 单个样本输入数据*/ double T[ON]; /* 单个样本输出数据*/ double W[HN][IN]; /*/ 输入层至隐层权值*/ double V[ON][HN]; /*/ 隐层至输出层权值*/ double X[HN]; /*/ 隐层的输入*/ double Y[ON]; /*/ 输出层的输入*/ double H[HN]; /*/ 隐层的输出*/ double O[ON]; /*/ 输出层的输出*/ double YU_HN[HN]; /*/ 隐层的阈值*/ double YU_ON[ON]; /*/ 输出层的阈值*/ double err m[N]; /*/第m 个样本的总误差*/ double a; /*/ 输出层至隐层的学****效率*/ double b; /*/ 隐层至输入层学****效率*/ double alpha; /*/ 动量因子,改进型 bp 算法使用*/ double d err[ON]; FILE *fp; /* 定义一个放学****样本的结构*/ struct { double input[IN]; double teach[ON]; }Study_Data[N]; /* 改进型 bp 算法用来保存每次计算的权值*/ struct { double old_W[HN][IN]; double old_V[ON][HN]; }Old_WV[Z]; 显示开始界面 int Start_Show() { clrscr(); printf("\n ***********************\n"); printf(" * e to use *\n"); printf(" * this program of *\n"); printf(" * calculating the BP *\n"); printf(" * model! *\n"); printf(" * Happy every day! *\n"); printf(" ***********************\n"); printf("\n\n Before starting, please read the follows carefully:\n\n"); printf(" ensure the Path of the ' '() is \n correct, like 'F:\BP\ '!\n"); printf(" calculating results will be saved in the Path of 'F:\\BP\\'!\n"); printf(" program will load 10 datas when running from 'F:\\BP\\ '!\n"); printf(" program of BP can study itself for no more than 30000 times.\n And surpassing the number, the program will be ended by itself in\n preventing running infinitely because of error!\n"); printf("\n\n\n"); printf("Now press any key to start...\n"); getch(); getch(); clrscr(); } 显示结束界面 int End_Show() { printf("\n\n---------------------------------------------------\n"); printf("The program has reached the end essfully!\n

BP算法程序C语言实现 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数11
  • 收藏数0 收藏
  • 顶次数0
  • 上传人63229029
  • 文件大小53 KB
  • 时间2017-04-13