Escolar Documentos
Profissional Documentos
Cultura Documentos
Module 2
Simple Neural
Networks
UTM
1
Module 2 Contents
The Perceptrons
1
Module 2 Objectives
From this module, the student should be able to understand
neural networks from a historical point of view.
By understanding the limitations of primitive neural networks
can provide us with new insights on new neural network
paradigms.
This module will allow the student to understand several
primitive neural networks such as the McCulloch Pitts neuron,
Hebb neural networks, Perceptrons, etc. and how they are used
to solve simple pattern classification problems.
To study some of the important early developments in neural
networks.
To be able to understand how they have been used in pattern
classification.
To see their limitations and the need for better models and
learning algorithms. 3
2
2.1 Historical Perspectives
Biological Neuron
of ANN
Artificial Neuron
x1
W11 sum = W 11x + W 12x +...+ W1NxN
1 2
x2
W12
x3 f()
S
W13
•
W1jxj O
•
1
W1N
•
xN
Neural Networks
3
Why do we need to study
from a historical
perspective?
It is important to study ANNs from its historical
perspectives such that we would be able to know the
pitfalls of primitive ANNs and also able to study the
measures the researchers took to overcome such
limitations.
4
Hebb’s learning rule (referred to as “Hebbian learning”) has a
number of limitations (see 2.2.3).
This nail the research in ANNs and from the 1970s, it became
the “Quiet years” in ANN research.
10
5
The Perceptrons
11
Mark I Perceptron
6
Mark I Perceptron
7
Research in ANNs - 1970s ~ 1980s (The Quiet Years)
15
8
2.2 General Information on ANN
2.2.1 Biases and Thresholds
2.2.2 Linear Separability
17
9
• A neural network input S with a bias signal can be
written as follows:
S b xi wi
1 b
W1
S
x1
y
W2
x2
19
o
q
10
2.2.2 Linear Separability
Weights and biases in an ANN determine the boundary regions
that separate the ANN output
(-)
(-)
21
ANN Performance
The performance of an ANN is described by
the figure of merit, which expresses the
number of recalled patterns when input
patterns are applied, that could be complete,
partially complete, or even noisy.
11
ANN PERFORMANCE
000 = MOUSE
001 = RABBIT
010 = COW
23
Network topology
Number of layers in the network
Number of neurons per layer
Number of calculations per iterations
Speed to recall a pattern
Network performance
Network plasticity (i.e. the no. of neurons failing and
the degree of functionality of the ANN)
Network capacity (max pattern signals that the ANN
can recall)
24
12
Important ANN Parameters [2]
Degree of adaptability of the ANN (to what extent the
ANN is able to adapt to itself after training)
Input
Pattern Output
YES
NO
26
13
Several examples of these neural networks
McCulloch-Pitts neuron ~ 1st artificial neuron
28
14
• Architecture of the McCulloch-Pitts Neuron:
1 if s >= q
f(s) =
0 if s < q
S
f( )
W13 1
x3 W1jxj Oj
o
q
W1N N
xN
Oj = f ( SW
i =1
ij xj )
29
x1 x2 y
q, threshold for y is 2
1 1 1
1 0 0
0 1 0
0 0 0
x1 W=1
S Wij
1
o y
W=1 2
x2
y= f ( SW ij xj )
30
15
Example to solve an OR function
x1 x2 y
1 1 1
1 0 1
q, threshold for y is 2 0 1 1
0 0 0
x1 W=2
S Wij
1
2
o
y
W=2
x2
y= f ( SW
ij xj )
31
x1 x2 y
1 1 1
1 0 0
0 1 0
0 0 1
w=2
x1 z1 w=2
w=-1
y y
w=-1
x2 w=2
w=2 z2
32
16
2.2.4 The Perceptrons
Developed by Frank Rosenblatt (1958).
wi ( new ) wi ( old ) Tx i
33
xi ui .
Step 4. Compute response of output unit:
s b xi wi
i
1 if s q
q is a threshold value
y 0 if -q s < q
assigned between 0 and 1
1 if s < - q
34
17
The Perceptron Algorithm
Step 5 Update weights and bias if an error occurred for this pattern:
If y t
w i (new ) wi (old ) txi .
b (new ) b (old ) t.
else
w i (new ) wi (old ),
b (new ) b (old ).
35
Exercise 2.2a
1
x1 x2 t b
1 1 1 x1 W1
1
-1
-1
1
-1
-1
W2
S y
-1 -1 -1
x2
• Using the Perceptron network, solve the AND problem above (using
bipolar activations) and show the results of the weights adaptation for
each pattern over 1 epoch.
• Choose all initial weights to be -1, =0.5, and q=0.2
• Fill up the following table.
Iter# x1 x2 s y t w1 w2 b
36
18
Exercise 2.2b
x1 x2 x3 t
-1 -1 -1 -1 1
b
-1 -1 1 1
-1 1 -1 1 x1 W1
-1 1 1 1 y
x2
f
W2
1 -1 -1 1 W3
1 -1 1 1 x3
1 1 -1 1
1 1 1 1
• Using the Perceptron network (3-input), solve the OR problem above
(using bipolar activations) and show the results of the weights
adaptation for each pattern over 1 epoch.
• Choose all initial weights to be -0.5, =0.25, and q=0.1
• Fill up the following table.
37
19
Iter. #2 (-1 -1 1 t=1) : s = 0.75 + (-0.25*-1) + (-0.25*-1) + (-0.25*1)
s = 0.75 + 0.25 + 0.25 - 0.25 = 1
y = 1 (1>0.1)
t=1
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
39
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
40
20
Iter. #6 (1 -1 1 t=1) : s = 0.75 + (-0.25*1) + (-0.25*-1) + (-0.25*1)
s = 0.75 - 0.25 + 0.25 - 0.25 = 0.5
y = 1 (0.5>0.1)
t=1
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
y = t, hence No Adaptation
w1(new) = w1(old) = -0.25
w2(new) = w2(old) = -0.25
w3(new) = w3(old) = -0.25
b(new) = b(old) = 0.75
41
21
Epoch #1
x1 x2 x3 s y t w1 w2 w3 b
43
Epoch #2
x1 x2 x3 s y t w1 w2 w3 b
- - - 0 0 0 1
-1 -1 -1 1 1 -1 0.25 0.25 0.25 0.75
-1 -1 1 0.5 1 1 0.25 0.25 0.25 0.75
-1 1 -1 0.5 1 1 0.25 0.25 0.25 0.75
-1 1 1 1 1 1 0.25 0.25 0.25 0.75
1 -1 -1 0.5 1 1 0.25 0.25 0.25 0.75
1 -1 1 1 1 1 0.25 0.25 0.25 0.75
1 1 -1 1 1 1 0.25 0.25 0.25 0.75
1 1 1 1.5 1 1 0.25 0.25 0.25 0.75
44
22
Epoch #3
x1 x2 x3 s y t w1 w2 w3 b
45
Epoch #4
x1 x2 x3 s y t w1 w2 w3 b
46
23
Epoch #5
x1 x2 x3 s y t w1 w2 w3 b
47
48
24