Module 200: An Introduction to Neural Networks


UNIT 2: Analysing artificial neurons and networks


UNIT 2

Contents:


A simple artificial neuron in C++
Networks of artificial neurons
The Perceptron
Laboratory workbook exercises
References
//summation function, threshold value (> 1),
//activation function

if ((weight_a * input_a) + (weight_b * input_b) > 1)
actual_output = 1;
else
actual_output = 0;

//adjust weights if actual output incorrect

if (actual_output != correct_output)
{
weight_a = weight_a + (1 * input_a *(correct_output - actual_output));
weight_b = weight_b + (1 * input_b
*(correct_output - actual_output));
}

//enter the input data in an AND gate

int input[]={input_a, input_b};
and_func(input);

//define correct output as output of AND gate

correct_output = and_func(input);

// AND function (takes 2 inputs)

int and_func(int inputs[])
{
if(inputs[0] && inputs[1])
return 1;
else
return 0;
}

OR XOR

Inputs Outputs Inputs Outputs
0 1 1 0 1 1
1 0 1 1 0 1
0 0 0 0 0 0
1 1 1 1 1 0

Laboratory workbook exercises


Example HR

The Laboratory workbook exercises for this Unit are contained in the Unit 2 chapter of the workbook.


References

Example HR

1. Illustration of two artificial neural networks which can emulate XOR gates taken from Middle East Technical University, Turkey, 'Introduction to Neural Networks':
http://www.ii.metu.edu.tr/~ion526/demo/chapter1/section1.3/figure1_9e.html
2. Illustration of a Perceptron taken from an MSc thesis 'An investigation into the use of maximum likelihood classifiers, decision trees, neural networks and conditional probabilistic networks for mapping and predicting salinity' by Fiona Evans:
http://www.cmis.csiro.au/Fiona.Evans/personal/msc/html/chapter6.html


Top of page

Page updated 19.5.03