Professional Documents
Culture Documents
ANN Structure v2
ANN Structure v2
ANN Structure v2
Neural Networks:
Structure and Training
Department of Electronics
Carleton University, Ottawa, Canada
www.doe.carleton.ca/~qjz, qjz@doe.carleton.ca
Driver 1
Driver 2
Receiver 4
Driver 3 Receiver 3
Receiver 2
3
L3
L1 1 L2 2
Rs R3 C3
L4
Source R1 C1 R2 C2
Vp, Tr
4
R4 C4
…...
L1 L2 L3 L4 R1 R2 R3 R4 C1 C2 C3 C4 Rs Vp Tr e1 e2 e3
y1 y2
yj =S W ’jkZk
k
W ’jk Hidden Neuron Values
Z1 Z2 Z3 Z4
Zk = tanh(S Wki xi )
i
Wki
x1 x2 x3
Inputs
Q.J. Zhang, Carleton University
Neural Net Training
Objective:
Method CPU
“Stop”
“Start”
“Help”
Figure from Reference [L.H. Tsoukalas and R.E. Uhrig, Fuzzy and Neural Approaches in Engineering, Wiley, 1997.]
NL
1 2 . . . . (Output) Layer L
NL-1
1 2 3
. . . . (Hidden) Layer L-1
. . . . . . .
N2
1 2 3 . . . . (Hidden) Layer 2
N1
1 2 3
. . . . (Input) Layer 1
x1 x2 x3 xn
Q.J. Zhang, Carleton University
Information Processing In a Neuron
z il
(.)
il
l
S
w i0
l
wiN
z l 1 wil1 l 1
….
0
wil2
z Nl l11
z1l 1
z 2l 1
Q.J. Zhang, Carleton University
Neuron Activation Functions
Sigmoid 1
0.5
0
-25 -20 -15 -10 -5 0 5 10 15 20 25
Arctangent 0
-1
-2
-10 -8 -6 -4 -2 0 2 4 6 8 10
Hyperbolic 0
tangent -1
-2
-10 -8 -6 -4 -2 0 2 4 6 8 10
Arctangent function:
2
z ( ) arctan( )
NL-1
1 2 3
. . . . (Hidden) layer l
. . . . . . .
N2
1 2 3 . . . . (Hidden) layer 2
N1
1 2 3
. . . . (Input) layer 1
x1 x2 x3 xn
Q.J. Zhang, Carleton University
where: L = Total No. of the layers
Nl = No. of neurons in the layer #l
l = 1, 2, 3, …, L
wijl = Link (weight) between the neuron #i in the layer
#l and the neuron #j in the layer #(l-1)
For l 1 : zi l xi , i 1,2, , n, n N1
N l 1
For l 2, 3, , L : il wijl z lj1 , zil ( il )
j 0
where:
In -- n-dimensional unit cube 0 , 1n
1.2
0.6
1/(1 + e –x )
0.4
0.2
0
-6 -4 -2 0 2 4 6
Hidden neuron
2.0 1/(1 + e –(0.5x – 2.5) )
2.5
2
bias: -2.5
1.5
0.5
1
0.5
Suppose this neuron is zil. Weights wijl (or wkil+1)
0 affect the figure horizontally (or vertically).
-10 -5 0 5 10 15 20
Values of the w’s are not unique, e.g., by changing
signs of the 3 values in the example above.
Q.J. Zhang, Carleton University
Illustration of the Effect of Neural Network Weights
- Example with 1 input
3.5
3
bias: 1
2.5
2
2.0 0.8
1.5
-4.5
1
0.5
bias: -2.5 bias:
bias: -20
0 -26
-20 -10 0 10 20 30 40 50
-0.5
2.0
-1 0.5
1.0
-1.5
-2
bias: 1
1 0.7
2.3 -1.5
z1
bias: bias: bias: bias:
-0.25 -16
z1
0
z1 z2 z3 z4 -20
1.0 1.0
0.0 1.0 1.0
0.0
1.0 -1.0
xx22
x11
z1 as a function of x 1 and x2 :
z1 = 1/(1+exp(- x )) 1 x1 x2
Q.J. Zhang, Carleton University
Illustration of the Effect of Neural Network Weights
- Example with 2 inputs
y
x1 x2 z1 z2 z3 z4
-1 -1 -1 -1 -1 0
4.0 0.1
0.1 4.0 4.0
+1 +1 +1 +1 +1 0 0.1
4.0 0.1
x1 x2 z1 z2 z3 z4
-1 -1 -1 +1 0 0
4 -4
4 -4 -4
+1 +1 +1 -1 0 0 -4
4 4
-1 -1 -1 +1 -1 -1
-1 +1 -1 +1 -1 -1
+1 -1 -1 +1 -1 -1
bias: bias: bias: bias:
+1 +1 -1 +1 -1 +1 10 -12
-4
z1 z2 z3 4
z4 -4
40 40 +1 +1 +1 +1 0.1 0.1
4
4
0.1 4
-70 -70 -1 -1 -1 -1 0.1
1.0 1.0
0.0 1.0 1.0
0.0
-1.0
When the connection weights and 1.0
y = f(x, w) x1 x2
Q.J. Zhang, Carleton University
Question: How many neurons are needed?
Essence: The degree of non-linearity in original problem.
experience
Solution: trial/error
adaptive schemes
Structure:
y1 ym
wij
Z1 Z2 ZN
ij, cij
x1 xn
1
()
0.5 a = 0.4
a = 0.9
0
-10 -6 -2 2 6 10
1
( ) 2
, 0
(c )
2
0.8
0.2
0
-4 -3 -2 -1 0 1 2 3 4
-0.2
( ) exp( ( / )2 )
n x j cij
i ( )2 i 1 ,2 , , N , 0 0
j 1 ij
cij is the center of radial basis function, ij is the width factor.
wij
Z1 Z2 ZN
a1 a2 aN
tij
x1 xn
x tj
For hidden neuron z j: z j ( j ) ( )
aj
where tj = [ tj1 , tj2 , . . . , tjn]T is the translation vector, a j is the dilation
factor, () is a wavelet function:
2
xtj xi t ji
j
n
( j ) ( j ) ( j n)e
2 2
where j ( )2
aj i 1 aj
0.5 a1 = 1
z
0
a1 = 5
-0.5
-1
-20 -10 0 10 20
Wavelet Networks
Feedforwad neural
network
….
y(t-) y(t-2) y(t-3) x(t-) x(t-2)
x(t)
Q.J. Zhang, Carleton University
Dynamic Neural Networks (DNN)
(continuous time domain)
The neural network directly represents the dynamic input-output relationship of
the problem. The input-output signals and their time derivatives are related
through a feedforward network.
y(t)
Feedforwad neural
network
….
y’(t) y’’(t) y’’’(t) x’(t) x’’(t)
x(t)
Q.J. Zhang, Carleton University
Self-Organizing Maps (SOM), (Kohonen, 1984)
Clustering Problem:
Given training data xk, k = 1, 2, …, P,
Find cluster centers ci, i = 1, 2, …, N
and the process continues until ci does not move any more.
Q.J. Zhang, Carleton University
Self Organizing Maps (SOM)
SOM is a one or two dimensional array of neurons where the
neighboring neurons in the map correspond to the neighboring
cluster centers in the input data space.
Two-dimensional array of
neurons
input
where p i Nc , q j Nc
Nc – size of neighborhood
x y
x Specific MLP for
group 2
y
x y
Control Specific MLP for
group 3
General MLP
x y
Specific MLP for
group 4
Q
Control
SOM
c