Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Hebb neural network

0.00/5 (No votes)
31 Oct 2007 1  
implementation of ocr by hebb algorithm

Introduction

In the name of God.

This a sample for OCR(Optical Character Recognition) in c#.

At this Program use the Hebb Algorithm.

Background

Donald Hebb in 1949 write a Article for single-layer problem.

Using the code

int y=0; int j;
int[,] total ={
{1,-1,-1,-1,1,-1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,-1,-1,-1,1},
{-1,1,1,1,-1,1,-1,-1,-1,1,1,-1,-1,-1,1,1,-1,-1,-1,1,-1,1,1,1,-1 }
}; 
int[] temp = new int[25];
for (int i = 0; i < 2; i++)
{
for ( j = 0; j < 25; j++)
temp[j] = total[i,j];
switch(i){
case 0: y=1;break;
case 1: y=-1;break;
}
for (j = 0; j < 25; j++)
{
weight[j] = weight[j] + temp[j] * y;
bias = bias + y;
}
}
for (j = 0; j < 25; j++)
{
weights.Items.Add("w"+j.ToString()+" : "+ weight[j].ToString());
}
weights.Items.Add("bias : "+bias.ToString());

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here