Neural Networks C Code

(by K. Kutza)


The following programs were written by K. Kutza in portable, self-contained ANSI C with example applications. These can be used as templates for implementing the problems in Homework # 4.

Network Application Description
ADALINE
Adaline Network
Pattern Recognition
Classification of Digits 0-9
The Adaline is essentially a single-layer backpropagation network. It is trained on a pattern recognition task, where the aim is to classify a bitmap representation of the digits 0-9 into the corresponding classes. Due to the limited capabilities of the Adaline, the network only recognizes the exact training patterns. When the application is ported into the multi-layer backpropagation network, a remarkable degree of fault-tolerance can be achieved.
BPN
Backpropagation Network
Time-Series Forecasting
Prediction of the Annual Number of Sunspots
This program implements the now classic multi-layer backpropagation network with bias terms and momentum. It is used to detect structure in time-series, which is presented to the network using a simple tapped delay-line memory. The program learns to predict future sunspot activity from historical data collected over the past three centuries. To avoid overfitting, the termination of the learning procedure is controlled by the so-called stopped training method.
HOPFIELD
Hopfield Model
Autoassociative Memory
Associative Recall of Images
The Hopfield model is used as an autoassociative memory to store and recall a set of bitmap images. Images are stored by calculating a corresponding weight matrix. Thereafter, starting from an arbitrary configuration, the memory will settle on exactly that stored image, which is nearest to the starting configuration in terms of Hamming distance. Thus given an incomplete or corrupted version of a stored image, the network is able to recall the corresponding original image.

You can download the complete package (also includes code for other types of neural networks) in a comprehensive .zip file. This file will explode to a directory structure, containing the C source, MS Visual C++ 4.0 makefile, Win32 executable, and the generated output for each of the above mentioned programs.

Code written by:

Karsten Kutza
Chausseestraße 1
D-14109 Berlin
Germany