Professional Documents
Culture Documents
Artificial Intelligence (AI) - Neural Networks
Artificial Intelligence (AI) - Neural Networks
Neural Networks
Portsmouth
13/09/2012
Historic Portsmouth
Home of HMS
Victory, the Mary
Rose and HMS Warrior
Historic Old
Portsmouth with
cobbled streets and
ancient buildings
Birthplace of Charles
Dickens and home of
Sir Arthur Conan
Doyle
HMS Victory in Portsmouth, 1900.
13/09/2012
Established in 1869
First degree awarded in
1900
Over 20,000 students,
3,500 from overseas
30 academic departments
across five faculties
Over 500 degree
programmes
Extensive range of world
leading and internationally
excellent research
Five Faculties
Portsmouth
Business
School
Creative and
Cultural
Industries
Humanities and
Social Sciences
Science
Technology
Park Building
13/09/2012
School of Computing
13/09/2012
Outline
13/09/2012
Introduction
The Perceptron
ADALINE example
Backpropagation
Dr. I. Jordanov
Dr. I. Jordanov
10
Additional reading
Chris Bishop, Neural Networks for Pattern Recognition,
Clarendon Press: Oxford, 2004.
B. D. Ripley, Pattern Recognition and Neural Networks,
Cambridge University Press, 2007.
R. Haupt & S. Haupt, Practical Genetic Algorithms, Wiley, 1998.
E. Lamm and R. Unger, Biological Computation, CRC Press,
2011.
M. Jones, Artificial Intelligence, Jones&Bartlett, 2009.
M. Negnevitsky, Artificial Intelligence, Addison Wesley, 2002.
Zbigniev Michalewicz, GA+ Data Structures = Evolution
Programs (2nd ed.), Springer Verlag, 1999.
Phil Picton, Neural Networks (2nd ed.), Palgrave, 2000.
David Goldberg, Genetic Algorithms, Addison-Wesley, 1989.
There are many others - some cheaper, so have a good browse.
13/09/2012
Dr. I. Jordanov
11
Useful sites
www.alibris.com/search/books/ - search for cheap books;
www.ics.uci.edu/~mlearn/MLRepository.html - a NN repository;
www.cs.toronto.edu/~delve/ - a repository of problems;
ftp.sas.com/pub/neural/FAQ.html - general information on NN;
www.aic.nrl.navy.mil/~aha/research/machine-learning.html - a
repository;
dsp.jpl.nasa.gov/members/payman/swarm/ - resources on
swarm intelligence;
alife.santafe.edu information on Artificial Life (AL);
www.evalife.dk/bbase - Evolutionary Computing (EC) and AL
repository;
www.informatik.uni-stuttgart.de/ifi/fk/evolalg/ - EC repository.
www.nd.com/ - NeuroDimension (info about NN & GA)
13/09/2012
Dr. I. Jordanov
12
Introduction
13/09/2012
Dr. I. Jordanov
13
13/09/2012
Dr. I. Jordanov
14
1. Introduction to ANN
13/09/2012
15
Dr. I. Jordanov
16
(a)
(b)
Dr. I. Jordanov
17
Dr. I. Jordanov
18
13/09/2012
Dr. I. Jordanov
19
13/09/2012
20
13/09/2012
21
2. The Perceptron
Iuput
x0
x1
w0
x2
w1
w2
xn
13/09/2012
Summing
junction
Activation
function
Output
O(x)
wn
Figure 10. A Perceptron.
Dr. I. Jordanov
22
13/09/2012
23
ADALINE
13/09/2012
+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
24
y( x )
1 if x 0,
1 if x 0.
x wi xi
i0
13/09/2012
Dr. I. Jordanov
25
13/09/2012
26
Input Layer
(Layer 0)
x0
x1 -1
-1
+1
-1
-1
-1
-1
-1
+1
x2 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
x3
Output Layer
(Layer 1)
w0i
-34
-1
+1
+1
-1
x35
y0
y( x )
1 if x 0,
1 if x 0.
-1
y1
-1
y2
-1
y3
+1
-1
y9
-1
13/09/2012
Dr. I. Jordanov
28
-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
13/09/2012
Dr. I. Jordanov
29
13/09/2012
30
Linear separability
classification problem
Let's consider the two dimensional (2D) case from Fig.13,
when a pattern has only two inputs (+ bias). The weighted
2
sum will be: net x w x = w x + w x + w x
i 0
i i
0 0
1 1
2 2
x2
x1
Fig. 13. A Linearly separable pattern classification problem: black points
belong to class1 and whites to class2 (e.g., thin and fat classes
for people: x2- body height; x1 body weight).
13/09/2012
Dr. I. Jordanov
31
w0
w0
w1
w1
x2 x1 , ( x2 ax1 b, a , b ).
w2
w2
w2
w2
x2
b
x1
13/09/2012
-b/a
Fig. 13a. The two coefficients (weights) define the angle
between the line and x1 axes.
Dr. I. Jordanov
32
The line equation will be equal to 0 for every point (x1, x2)
belonging to the line (less than 0 for every point below and
greater than 0 for every point above the line):
f ( x ) x2 ax1 b 0
13/09/2012
33
Perceptron Learning as a
Minimization Problem
13/09/2012
Dr. I. Jordanov
34
3
x2
2
1
x1
Fig. 14. Decision surfaces (line 1 and line 2) with two misclassified patterns.
The distances are given in blue. Line 2 is better than line 1 (smaller sum of
distances, but still not a solution). Line 3 (green) is one possible solution.
(Assume, e.g., class1 (o) fat people; class2 () - thin people; (x1
body weight, x2 body height).
13/09/2012
Dr. I. Jordanov
35
J ( w)
wi xi w x
xX i 0
xX
13/09/2012
36
input 2
x2
: class 1,
: class 2
1.5
0.5
0.5
1.5
x1
x1
x2
x1 XOR x2
input 1
Dr. I. Jordanov
37
w1
ij
1 h0 w2ij
h1
x2
h2
y1
y2
yk
xn
Input Layer
(Layer 0)
hm
Hidden Layer
(Layer 1)
Output Layer
(Layer 2)
Dr. I. Jordanov
38
w0j
x2
w1j
w2j
x3
w3j
yj
Node j
13/09/2012
xj
xw
i 0
ij
39
Backpropagation Learning
Algorithm
The BP algorithm (also known as generalized delta rule)
is used for supervised learning (when the outputs are
known for given inputs).
13/09/2012
40
1
E
P 2
nL
( p)
( ti
p 1 i 1
( p) 2
y
)
i
13/09/2012
41
Dr. I. Jordanov
42
NN generalisation
(performance) evaluation
Testing subset
Fig. 19. Using the data set (split sample) for training
and generalisation evaluation.
13/09/2012
Dr. I. Jordanov
43
Dr. I. Jordanov
44
Validation
Training
Number of epochs
Fig. 21. Training with validation (to avoid overfitting).
13/09/2012
Dr. I. Jordanov
45
9 10
Training
1
Testing
9 10
Training
Testing
9 10
Training
Testing
Dr. I. Jordanov
46
13/09/2012
Dr. I. Jordanov
47
To summarise, NN:
Dr. I. Jordanov
48