Beruflich Dokumente
Kultur Dokumente
http://scholastictutors.webs.com
(ANN-001) 2
as
Classification Example
http://scholastictutors.webs.com 3
Classification Example
X2(Length in cm)
Class C1
20
(121,16.8)
16 (114,15.2)
12
(210,9.4)
8 (195,8.1)
4 Class C2
X1(Weight
http://scholastictutors.webs.com 50 100 150 200 250 in grams)
Artificial Neural Networks Theory
5
http://scholastictutors.webs.com
Artificial Neural Networks Theory
6
http://scholastictutors.webs.com
Intelligent Machine
7
http://scholastictutors.webs.com
Model of a Neuron
wk2
(.)
Input Signals
x2 vk
Output
wk3 yk
x3
Summing
x4 wk4 Junction
Synaptic Weights 8
http://scholastictutors.webs.com
Some Mathematics
http://scholastictutors.webs.com
Bias as an Input
• and
yk vk
• Note the change of limits of j from 1 to 0. 10
http://scholastictutors.webs.com
Modified Neuron Structure
Fixed Input
wk0 wk0=bk (bias)
x0 = +1
x1 wk1 Activation
Function
wk2
(.)
x2
vk Output
wk3 yk
x3
Summing
Junction
x4 wk4
Synaptic Weights
(including bias)
11
http://scholastictutors.webs.com
Types of Activation Functions
0.6
0.4
0.2
0
-2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 12
http://scholastictutors.webs.com
Types of Activation Functions (cont…)
1
• Piecewise-Linear Function: 1, v
2
1 1
(v ) v, v
2 2
1
0, v
2
1.0
(v )
0.8
0.6
0.4
0.2
0
-2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 13
http://scholastictutors.webs.com
Types of Activation Functions (cont…)
1
• Sigmoid Function: (v )
1 exp av
where a is the slope parameter of the sigmoid
function.
1.0
(v )
0.8
0.6 Increasing a
0.4
0.2
0
-8.0 -6.0 -4.0 -2.0 0 2.0 4.0 6.0 8.0 14
http://scholastictutors.webs.com
Single Layer Perceptron
http://scholastictutors.webs.com
Perceptron Convergence (Learning)
Algorithm
w( n) ( m 1) 1 weight vector
b( n ), w1 ( n ), w2 ( n ), , wm ( n )
T
b( n ) bias
y( n ) actual response
d ( n ) desired response
learning-rate parameter, a postive constant less than unity
16
http://scholastictutors.webs.com
Perceptron Convergence (Learning)
Algorithm (cont…)
http://scholastictutors.webs.com
Perceptron Convergence (Learning)
Algorithm (cont…)
4. Adaptation of Weight Vector. Update the
weight vector of the perceptron:
w( n 1) w( n) d ( n) y( n) x( n)
where
1 if x( n) belongs to class C1
d ( n)
1 if x( n) belongs to class C2
http://scholastictutors.webs.com
Decision Boundary
• The hyper-plane
x2
m
w x b 0
i 1
i i
Class C1
or
w1 x1 w2 x2 b 0 0 x1
http://scholastictutors.webs.com
Solution to the Example Question
(with correct initial weights and bias)
20
http://scholastictutors.webs.com
Solution to the Example
(with correct initial weights and bias)
Fixed Input
Activation
50
Function
x0 = +1
x1 -30 Output
300
sig (.)
y(n)
x2
1, if x0
sgn( x )
1, if x0
21
http://scholastictutors.webs.com
Solution to the Example
(with correct initial weights and bias) (cont…)
w1x1 w2 x2 b 0 16 (114,15.2)
12
30 x1 300 x2 50 0 (100,9.83) (210,9.4)
8 (195,8.1)
30 100 50 4 Class C2
x1 100, x2 9.83
300
50 100 150 200 250 x1
30 200 50
x1 200, x2 19.83
300
Initial hyper-plane does separate the two classes. 22
http://scholastictutors.webs.com
Classification of the Unknown Fruit
http://scholastictutors.webs.com
Fixed Input
Activation
50
x0 = +1 Function
x2 = 17.9
300
sig (.)
y(n)=+1
Class Unknown
For Class C1,
Now use the above model to classify the unknown fruit. Output = +1
x( unknown ) 1, 140, 17.9
T
y( unknown ) sgn w T (3)x( unknown ) sgn 50 1 30 140 300 17.9
sgn(1220) 1
this
this unknown
unkown fruit
fruit belonge to the
belongs to the class
class C1. 23
Solution to the Example Question
(with unknown initial weights and bias)
24
http://scholastictutors.webs.com
Solution to the Example
(with unknown initial weights and bias)
case: 20
30 x1 300 x2 1230 0 (121,16.8)
16
(100,14.1) (114,15.2)
30 100 1230 12
x1 100, x2 14.1 (210,9.4)
300 8 (195,8.1)
30 200 1230
x1 200, x2 24.1 4
300
http://scholastictutors.webs.com
Training with known Fruit
(121,16.8)
Fixed Input
Activation
-1230
x0 = +1 Function
y( n ) y(0) sgn w T ( 0)x( 0)
sgn 1230 1 30 121 300 16.8
sgn (180) 1 d (0)
Hence no need to recalculate the weights.
w( n 1) w(1) 1230, 30, 300
T
26
http://scholastictutors.webs.com
Training with known Fruit
(114,15.2)
Fixed Input
Activation
-1230
x0 = +1 Function
-90 y(n)=-1
sig (.)
x2 = 15.2
300
Class C1
For Class C1, the
y(1) sgn w T (1)x(1) sgn 1230 1 30 114 300 15.2
sgn( 90) 1 d (1)
Hence we have to recalculate the weights.
http://scholastictutors.webs.com
Adaptation of Weight Vector
w( n 1) w( n) d ( n) y( n) x( n)
w(1) 1230, 30, 300
T
28
http://scholastictutors.webs.com
Training with known Fruit
(210,9.4)
Fixed Input
-1229.08 Activation
x0 = +1 Function
x1 = 210 -27.72
Output
x2 = 9.4 -4227.4224
sig (.)
y(n)=-1
300.304
Class C2
http://scholastictutors.webs.com
Training with known Fruit
(195,8.1)
Fixed Input
-1229.08 Activation
x0 = +1 Function
x1 = 195 -27.72
Output
x2 = 8.1 -4202.0176
sig (.)
y(n)=-1
300.304
Class C2
http://scholastictutors.webs.com
Training with known Fruit
(121,16.8)
Fixed Input
-1229.08 Activation
x0 = +1 Function
x1 = 121 -27.72
Output
x2 = 16.8 461.91
sig (.)
y(n)=+1
300.304
Class C1
http://scholastictutors.webs.com
Training with known Fruit
(114,15.2)
Fixed Input
-1229.08 Activation
x0 = +1 Function
x1 = 114 -27.72
Output
x2 = 15.2 175.46
sig (.)
y(n)=+1
300.304
Class C1
32
http://scholastictutors.webs.com
Decision Boundary After Training
http://scholastictutors.webs.com
Classification of the Unknown Fruit
using the New Decision Boundary
Fixed Input
-1229.08 Activation
x0 = +1 Function
x1 = 140 -27.72
Output
x2 = 17.9 175.46
sig (.)
y(n)=+1
300.304
Class Unknown
http://scholastictutors.webs.com