当前位置: 首页 > news >正文

潍坊网站制作保定公司/百度电商平台app

潍坊网站制作保定公司,百度电商平台app,做网站猫要做端口映射吗,网站发展规划说实话,具体的训练公式,我没有自己推导,姑且认为他写的代码是对的。总体上看,用bp的方法。特殊之处,在于输入层和输出层是完完全全的“同一层”。 void dA::get_corrupted_input (int *x, // the original input 0-1…

说实话,具体的训练公式,我没有自己推导,姑且认为他写的代码是对的。总体上看,用bp的方法。特殊之处,在于输入层和输出层是完完全全的“同一层”。

 

void dA::get_corrupted_input (int *x,			// the original input 0-1 vector			-- inputint *tilde_x,	// the resulted 0-1 vector gotten noised	-- outputdouble p		// the p probability of noise, binomial test -- input) 
{for(int i=0; i<n_visible; i++) {if(x[i] == 0) {// if the state is 0, do noghing tilde_x[i] = 0;} else {// if the state is 1, add the noise of p probability on ittilde_x[i] = binomial(1, p);}}
}// Encode
void dA::get_hidden_values (int *x,		// the input from visible nodesdouble *y	// the output of hidden nodes) 
{for(int i=0; i<n_hidden; i++) {// calculated sum_j(vj * wij) + biy[i] = 0;for(int j=0; j<n_visible; j++) {y[i] += W[i][j] * x[j];}y[i] += hbias[i];// sigmod (y)y[i] = sigmoid(y[i]);}
}// Decode
void dA::get_reconstructed_input (double *y,	// the input from hidden nodesdouble *z	// the output reconstructed of visible nodes) 
{for(int i=0; i<n_visible; i++) {// calculated sum_j(hj * wij) + ciz[i] = 0;for(int j=0; j<n_hidden; j++) {z[i] += W[j][i] * y[j];}z[i] += vbias[i];// sigmod (z)z[i] = sigmoid(z[i]);}
}void dA::train (int *x,						// the input sample from visiable nodedouble lr,					// the learning ratedouble corruption_level		// corruption_level is the probability of noise) 
{// the auto-encoder networks:// input(visible) layer --> hidden layer --> output(visible) layer// the input layer is the same as the output layer, the two layers are totally same.// we train it by the standard bp algorithm, from output layer to the hidden layer, and to the input layer// Here is the whole process: int *tilde_x = new int[n_visible];		// the noise inputdouble *y = new double[n_hidden];		// the output of hidden layerdouble *z = new double[n_visible];		// the output of output layer, reconstructiondouble *L_vbias = new double[n_visible];	// temp value for visible biasdouble *L_hbias = new double[n_hidden];		// temp value for hidden biasdouble p = 1 - corruption_level;// make the input sample noise by the p probabilityget_corrupted_input(x, tilde_x, p);// calculate the output of hidden nodes by the noise input, encodeget_hidden_values(tilde_x, y);// reconstruct the input sample from visible nodes, decodeget_reconstructed_input(y, z);// update the bias of visible nodesfor(int i=0; i<n_visible; i++) {// the difference between input sample and the PROBABILITY of reconstructed probability of visible node// it's different from RBM that in RBM we calcualte the difference between input sample and // the 0-1 state of the reconstructed visiable node// here use the standard bp algorithm, from visible layer to hidden layerL_vbias[i] = x[i] - z[i];// update the value by the learning ratevbias[i] += lr * L_vbias[i] / N;}// update the bias of hidden nodesfor(int i=0; i<n_hidden; i++) {// propgate the bias from visible nodes// here use the standard bp algorithm, from visible layer to hidden layerL_hbias[i] = 0;for(int j=0; j<n_visible; j++) {L_hbias[i] += W[i][j] * L_vbias[j];}L_hbias[i] *= y[i] * (1 - y[i]);hbias[i] += lr * L_hbias[i] / N;}// update the weight of networksfor(int i=0; i<n_hidden; i++) {for(int j=0; j<n_visible; j++) {W[i][j] += lr * (L_hbias[i] * tilde_x[j] + L_vbias[j] * y[i]) / N;}}delete[] L_hbias;delete[] L_vbias;delete[] z;delete[] y;delete[] tilde_x;
}void dA::reconstruct (int *x,			// the input sample		-- inputdouble *z		// the reconstructed value -- output) 
{double *y = new double[n_hidden];// calculate the output of hidden layerget_hidden_values(x, y);// reconstruct from hidden layer to visible layerget_reconstructed_input(y, z);delete[] y;
}


 

 

http://www.lbrq.cn/news/1337005.html

相关文章:

  • iis5 新建网站/媒体公关
  • 商城做网站好还是淘宝/网站制作的基本流程
  • 泸州建设局网站/semiconductor是什么意思
  • 做宠物食品的网站/青岛百度快速排名优化
  • 厦门做网站优化价格/seo网络推广公司报价
  • 做电影网站需要注意什么软件/百度网盘网址
  • 微信如何分享wordpress/电影站的seo
  • 附近网站建设/seo技术培训学校
  • 域名停靠app网站入口/搜索引擎平台
  • 公司网站建设应注意事项/十大营销策划公司排名
  • 湘潭网站建设网站/宁波seo快速优化
  • 河南省政府门户网站百城建设/2022年新闻大事
  • 帮客户做网站平台犯法吗/无代码免费web开发平台
  • 关于做电影的网站设计/万网域名交易
  • 三联网站建设工作室/seo顾问阿亮博客
  • 网站建设需求方案文档/如何在百度发视频推广
  • 做简单网站用什么软件有哪些内容/网站建设合同模板
  • 个人网站毕业设计作品/最新的销售平台
  • 北京手机网站建设哪家好/本地建站软件有哪些
  • 深圳外贸电商网站建设/网页推广平台
  • 网站建设的技术准备/重庆网站建设维护
  • 设计图的网站/百度seo营销推广
  • 无锡网络推广/初学seo网站推广需要怎么做
  • 分析网站设计对网站搜索引擎友好性的影响/搜索引擎优化的内容
  • 给个营销型网站/北京seo优化外包
  • 平面设计图案/无锡优化网站排名
  • 如何将自己做的网站挂到服务器上/深圳百度推广代理商
  • 无锡网站搜索优化/北京seo推广服务
  • 天津网页制作网页报价/优化方案官方网站
  • 从零精通网站建设/公司软文怎么写
  • 基于 Spring Boot 的登录功能实现详解
  • 【11-计算机视觉介绍】
  • 每日算法刷题Day61:8.11:leetcode 堆11道题,用时2h30min
  • Qt串口通信设计指南:通信层架构与实践
  • 状态机浅析
  • 【递归、搜索与回溯算法】递归算法