标题:[求助]大家看看怎么把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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-67760-1-1.html




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

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