Академический Документы
Профессиональный Документы
Культура Документы
Introduction to
Artificial Neural Network
- theory, application
and practice using WEKA-
1
Example of BP calculation
Sepal Sepal Petal Petal Class
Length Width Length Width
5.1 3.5 1.4 0.2 Iris-setosa
7.0 3.2 4.7 1.4 Iris-
versicolor
2-class problem
4 attributes
ANN Architecture
Sepal-width Iris-setosa
Iris-versicolor
Petal-length
Petal-width
Suppose the hidden neurons is 3
Initialization
w j ,i
Sepal-length
0.1
0.1 wk , j
0.2 0.1
0.3 0.1
0.4 Iris-setosa
Sepal-width 0.2 0.2
0.5
0.6 0.3
0.2
0.7 0.4
0.8 0.3 0.5 Iris-versicolor
Petal-length 0.6
0.9
1.0 1.1 k
Petal-width 1.2 j
i
Forward Pass
Calculating the output of Input Layer
5.1 I1 = x1 = 5.1
Iris-setosa
3.5 I 2 = x2 = 3.5
Iris-versicolor
1.4 I 3 = x3 = 1.4
0.2 I 4 = x4 = 0.2
Forward Pass
Calculating the output of Hidden Layer
net1 = θ1 + ∑ w1,i I i
= 0.1 + (0.1× 5.1) + (0.4 × 3.5) + (0.7 ×1.4 ) + (1.0 × 0.2 )
i
= 3.19
1
H1 = f (net1 ) = −3.19
= 0.96
1+ e
Forward Pass
net2 = θ 2 + ∑ w2,i I i
= 0.2 + (0.2 × 5.1) + (0.5 × 3.5) + (0.8 ×1.4 ) + (1.1× 0.2 )
i
= 4.31
1
H 2 = f (net2 ) = − 4.31
= 0.99
1+ e
Forward Pass
net3 = θ 3 + ∑ w3,i I i
= 0.3 + (0.3 × 5.1) + (0.6 × 3.5) + (0.9 ×1.4 ) + (1.2 × 0.2 )
i
= 5.43
1
H 3 = f (net3 ) = −5.43
= 1.00
1+ e
Forward Pass
Calculating the output of Hidden Layer
5.1
H1 = 0.96
Iris-setosa
3.5 H 2 = 0.99
Iris-versicolor
1.4
H 3 = 1.0
0.2
Initialization
w j ,i
0.1 0.1 wk, j
0.2
0.3 0.1 0.1
0.4 0.2
0.5 0.2 0.3
0.6
0.4
0.7 0.2
0.8 0.5
0.3 0.6
0.9
1.0 1.1 k
1.2 j
i
Forward Pass
Calculating the output of Output Layer
net1 = θ1 + ∑ w1, j H j
j
= 0.1 + (0.1× 0.96) + (0.3 × 0.99 ) + (0.5 × 1.0 )
= 0.99
1
O1 = f (net1 ) = − 0.99
= 0.73
1+ e
Err1 = t1 − O1 = 1 − 0.73 = 0.27
Forward Pass
Calculating the output of Output Layer
net2 = θ 2 + ∑ w2, j H j
j
= 0.2 + (0.2 × 0.96) + (0.4 × 0.99) + (0.6 × 1.0 )
= 1.39
1
O2 = f (net2 ) = −1.39
= 0.80
1+ e
Err2 = t 2 − O2 = 0 − 0.80 = −0.80
Forward Pass
Calculating the output of Output Layer
5.1 I1 = 5.1
O1 = 0.73 t1 = 1
H1 = 0.96 Iris-setosa
3.5 I 2 = 3.5
H 2 = 0.99 Iris-versicolor
1.4 I 3 = 1.4
O2 = 0.80 t2 = 0
H 3 = 1.0
0.2 I 4 = 0.2
Training Process: Backward Pass
δ j = H j (1 − H j )∑ wk , jδ k
k
H1 = 0.96
0.1
0.2 O1 = 0.73
H 2 = 0.99 t1 = 1
0.3
0.4
0.5 O2 = 0.80
0.6 t2 = 0
H 3 = 1.0
Backward Pass
δ1 = (t1 − O1 )O1 (1 − O1 ) = (1 − 0.73) × 0.73 × (1 − 0.73) = 0.053
δ 2 = (t 2 − O2 )O2 (1 − O2 ) = (0 − 0.80) × 0.80 × (1 − 0.80) = −0.128
H1 = 0.96
0.1 δ1 = 0.053
0.2 O1 = 0.73
H 2 = 0.99 t1 = 1
0.3
0.4
0.5 O2 = 0.80
0.6 t2 = 0
δ 2 = −0.128
H 3 = 1.0
Training Process: Backward Pass
δ j = H j (1 − H j )∑ wk , jδ k
k
0.6 t2 = 0
δ3 = 0 δ 2 = −0.128
H 3 = 1.0
Training Process: Backward Pass
δ j = H j (1 − H j )∑ wk , jδ k
k