91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

用ANN實(shí)現(xiàn)的異或,使用了單隱層的BP算法。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#define?N_SAMPLES?4
/***************
網(wǎng)絡(luò)如下:?
o-------
0??\????\
???2o----o3
1??/????/
o-------
****************/
float?X[N_SAMPLES][2]?=?{10011100};???????????//每個(gè)訓(xùn)練的輸入?
float?d[N_SAMPLES]?=?{1100};?????????????????????????//每個(gè)訓(xùn)練的標(biāo)準(zhǔn)輸出?
float?w03w02w13w12w23;
float?theta[4];
float?delta[4];

float?e;
float?E_sum;
float?E_bar;
float?E?=?0.000001;

float?eta?=?0.001;

float?v[4];
float?y[4];
float?abs(float?a)
{
??????if(a>=0)?return?a;
??????if(a<0)?return?(0-a);
}?
float?sigmoid(float?v)?????????????
{
float?f;
f=1/(1+exp(-v));
return?f;
}
float?sigmoid_1(float?v)
{
????return?sigmoid(v)*(1-sigmoid(v));
}
int?init()
{
????srand((unsigned)time(NULL));
????w03?=?rand()/32767.0?-?0.5;
????w02?=?rand()/32767.0?-?0.5;
????w13?=?rand()/32767.0?-?0.5;
????w12?=?rand()/32767.0?-?0.5;
????w23?=?rand()/32767.0?-?0.5;
????theta[0]?=?rand()/32767.0?-?0.5;
????theta[1]?=?rand()/32767.0?-?0.5;
????theta[2]?=?rand()/32767.0?-?0.5;
????theta[3]?=?rand()/32767.0?-?0.5;
}
int?main()
{
????init();
????do
????{
????????E_sum?=?0.0;
????????int?i;
????????for?(i?=?0;

評(píng)論

共有 條評(píng)論

相關(guān)資源