| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 754 人关注过本帖
标题:[求助]大家看看怎么把C语言程序改成汇编?
只看楼主 加入收藏
cyzzhe
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-5-11
收藏
 问题点数:0 回复次数:1 
[求助]大家看看怎么把C语言程序改成汇编?

void calcOutputNet()

{

int i;

int j;

//calculate the outputs of the hidden neurons

//the hidden neurons are tanh

for(i = 0;i<numHidden;i++)

{

hiddenVal[i] = 0.0;

for(j = 0;j<numInputs;j++)

hiddenVal[i] = hiddenVal[i] + (trainInputs[0][j] * weightsIH[j][i]);

hiddenVal[i] = tanh(hiddenVal[i]);

}

//calculate the output of the network

//the output neuron is linear

outPred = 0.0;

//calculate the output of the network

//the output neuron is linear

//outPred = 0.0;

for(i = 0;i<numHidden;i++)

outPred = outPred + hiddenVal[i] * weightsHO[i];

//calculate the error

//errThisPat = outPred - trainOutput[patnum];

}

//****************************************************//

//********** THIS IS THE MAIN PROGRAM **************************

//==============================================================

main ()

{

int i;

int j;

//initiate the weights

initWeights();

//load in the data

initData();

//train the network

for(j = 0;j <= numEpochs;j++)

{

for(i = 0;i<numPatterns;i++)

{

//select a pattern at its squence

patNum =i;

//calculate the current network output

//and error for this pattern

calcNet();

//change network weights

WeightChangesHO();

WeightChangesIH();

}

//display the overall network error

//after each epoch

for(i = 0;i<numPatterns;i++)

{

patNum =i;

calcOverallError();

}

printf("epoch =%d RMSError =%d\n " ,j, RMSerror);

}

//training has finished

//display the results

displayResults();

// trainInputs[0][0] = 1;

// trainInputs[0][1] = 1;

//trainInputs[0][2] = 1;//bias

//trainInputs[0][3] = 1;

//trainInputs[0][4] = 1;

//trainInputs[0][5] = 1;

// calcOutputNet();

trainInputs[0][0] = 1;

trainInputs[0][1] = 1;

trainInputs[0][2] = 1;//bias

trainInputs[0][3] = 1;

trainInputs[0][4] = 1;

trainInputs[0][5] = 1;

trainInputs[0][6] = 1;

trainInputs[0][7] = 1;

trainInputs[0][8] = 1;

trainInputs[0][9] = 1;

trainInputs[0][10] = -1;

trainInputs[0][11] = -1;

calcOutputNet();

}

//=============================================================

//********** END OF THE MAIN PROGRAM *********************
搜索更多相关主题的帖子: C语言 Times face 
2006-05-27 16:46
lxgaaa
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-5-17
收藏
得分:0 
同问,不懂

天高任鸟飞,海阔任鱼翱
2006-05-28 18:42
快速回复:[求助]大家看看怎么把C语言程序改成汇编?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.044291 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved