ANN MODULE 1 Part2
ANN MODULE 1 Part2
2
3
Here's a breakdown of the components:
Bias: The bias is a constant term added to the weighted sum. It helps
the perceptron account for cases where all input values are zero.
4
The most common activation function used in perceptrons is the step
function or the sign function. The step function outputs 1 if the
weighted sum plus bias is greater than or equal to zero, and it outputs 0
otherwise. This essentially makes the perceptron act as a simple
threshold-based binary classifier
5
6
7
8
9
10
Linear Separability
⚫ Linear Separable:
⚫ Linear inseparable:
⚫ Solution?
Multilayer Perceptron
13
Multilayer Perceptron
(MLP)
Output Values
Output Layer
Adjustable
Weights
Input Layer
Output Signals
Input Signals
First Second
Input hidden hidden Output
layer layer layer layer
What does the middle layer hide?
◆A hidden layer “hides” its desired output.
◆ Neurons in the hidden layer cannot be observed
through the input/output behaviour of the network.
◆ There is no obvious way to know what the desired
output of the hidden layer should be.
◆ Commercial ANNs incorporate three and sometimes
four layers, including one or two hidden layers.
◆ Each layer can contain from 10 to 1000 neurons.
◆ Experimental neural networks may have five or
even six layers, including three or four hidden layers,
and utilise millions of neurons.
17
18
19
Delta Rule
21
Error
x1 wk1
x2 wk2
. .
. . ok
. .
xm wkm
bk
1
ok = f ( y k ) =
1 + e − yk
E 1
=
wi wi 2 dD
(td − od ) 2
=
1
2 dD wi
(td − od ) 2
(td − od )
=
1
2 dD
2(td − o d )
wi
od
= − (td − od )
dD wi
od yd
= − (td − od ) chain rule
dD yd wi
n
( xiwi )
1
= − (td − od ) ( − yd
) i=0
Sigmoid
dD yd 1+ e wi function
= − (td − od )od (1− od )xi Continue….
dD 35
E
wi = − = (td − od )od (1− od )xi
wi dD
36
What is Backpropagation?
32
Steps in Back propagation Algorithm
⚫ STEP ONE: initialize the weights and biases.
x1 w1j
f
output y
xn wnj
where wij is the weight of the connection from unit i in the previous layer to
unit j; Oi is the output of unit I from the previous layer;
j
is the bias of the unit
Propagate the inputs forward
j = (l) Errj
j = j + j
Update weights and biases
⚫ We are updating weights and biases after the
presentation of each sample.
⚫ This is called case updating.
Output vector
Errk = Ok (1 − Ok )(Tk − Ok )
Output nodes
1 Err j = O j (1 − O j ) Errk w jk
Oj = −I j k
1+ e
Hidden nodes
Input vector: xi
Example of Back propagation
Input = 3, Hidden
Neuron = 2 Output =1
Initialize weights :
Random Numbers
from -1.0 to 1.0
⚫ Bias ( Random )
θ4 θ5 θ6
Unit j Error j
6 0.475(1-0.475)(1-0.475) =0.1311
We assume T 6 = 1
……..similarly ………similarly
48
49
50
51
52
53
54
55
56
57
Applications
⚫ domains and tasks where neural networks are
successfully used
• recognition
• control problems
• series prediction
• weather, financial forecasting
• categorization
• sorting of items (fruit, characters, …)