C++ Neural Networks and Fuzzy Logic: Preface


C++ Neural Networks and Fuzzy Logic



Download 1,14 Mb.
Pdf ko'rish
bet253/443
Sana29.12.2021
Hajmi1,14 Mb.
#77367
1   ...   249   250   251   252   253   254   255   256   ...   443
Bog'liq
C neural networks and fuzzy logic

C++ Neural Networks and Fuzzy Logic

by Valluru B. Rao

MTBooks, IDG Books Worldwide, Inc.



ISBN: 1558515526   Pub Date: 06/01/95

Previous Table of Contents Next

The new member functions are shown in italic. The functions display_input_char() and

display_winner_weights() are used to display the input and weight maps on the screen to watch weight

character map converge to the input map.

The implementation of these functions is in the file, layerk.cpp. The portion of this file containing these

functions is shown in Listing 12.2.



Listing 12.2 Additions to the layerk.cpp implementation file

void Kohonen_network::display_input_char()

{

int i, num_inputs;



unsigned char ch;

float temp;

int col=0;

float * inputptr;

num_inputs=layer_ptr[1]−>num_inputs;

inputptr = layer_ptr[1]−>inputs;

// we’ve got a 5x7 character to display

for (i=0; i

       {

       temp = *(inputptr);

       if (temp <= 0)

              ch=255;// blank

       else if ((temp > 0) && (temp <= 0.25))

              ch=176; // dotted rectangle −light

       else if ((temp > 0.25) && (temp <= 0.50))

              ch=177; // dotted rectangle −medium

       else if ((temp >0.50) && (temp <= 0.75))

              ch=178; // dotted rectangle −dark

       else if (temp > 0.75)

              ch=219; // filled rectangle

       printf(“%c”,ch); //fill a row

       col++;

       if ((col % 5)==0)

              printf(“\n”); // new row

       inputptr++;

       }


printf(“\n\n\n”);

}

void Kohonen_network::display_winner_weights()



{

int i, k;

unsigned char ch;

float temp;

float * wmat;

int col=0;

int win_index;

C++ Neural Networks and Fuzzy Logic:Preface

C++ Code Development

247



int num_inputs, num_outputs;

num_inputs= layer_ptr[1]−>num_inputs;

wmat = ((Kohonen_layer*)layer_ptr[1])

              −>weights;

win_index=((Kohonen_layer*)layer_ptr[1])

              −>winner_index;

num_outputs=layer_ptr[1]−>num_outputs;

// we’ve got a 5x7 character to display

for (i=0; i

       {


       k= i*num_outputs;

       temp = wmat[k+win_index];

       if (temp <= 0)

              ch=255;// blank

       else if ((temp > 0) && (temp <= 0.25))

              ch=176; // dotted rectangle −light

       else if ((temp > 0.25) && (temp <= 0.50))

              ch=177; // dotted rectangle −medium

       else if ((temp > 0.50) && (temp <= 0.75))

              ch=178; // dotted rectangle −dark

       else if (temp > 0.75)

              ch=219; // filled rectangle

       printf(“%c”,ch); //fill a row

       col++;

       if ((col % 5)==0)

              printf(“\n”); // new row

       }

printf(“\n\n”);

printf(“—————————−\n”);

}

The final change to make is to the kohonen.cpp file. The new file is called pattern.cpp and is shown in Listing



12.3.


Download 1,14 Mb.

Do'stlaringiz bilan baham:
1   ...   249   250   251   252   253   254   255   256   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish