1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
for (int j = 1 ; j <= N; j++)
{
for (int i = 1; i <= M; i++)
{
float a = coeffapp();
dist[j] += pow((X[j] - W[i][j]),2);
W1[j] = W[i][j] + a*(X[j] - W[i][j]);
W2[j] = W[i][j] - a*(X[j] - W[i][j]);
}
if(dist[j]<dmin)
Eg = Ep[j];
dmin = dist[j];
if(Ep[j] == Ef){
Wg[j] = W1[j];
}
else{
Wg[j] = W2[j];
}
printf("distance[%d]= %f\n",j, dist[j]);
printf("distance minimale correspondante au neurone gagnant:%f\n",dmin);
printf("l'étiquette de neuronne gagnant:%f\n",Eg);
printf(" wg[%d]== %f\n",j, Wg[j]); |
Partager