Artificial Neural Networks: Slides Are By: Tan, Steinbach, Karpatne, Kumar
Artificial Neural Networks: Slides Are By: Tan, Steinbach, Karpatne, Kumar
Artificial Neural Networks: Slides Are By: Tan, Steinbach, Karpatne, Kumar
What is this?
You see this:
(INPUT)
(OUTPUT)
0 1 0 -1
0 1 1 1 X3 0.3 t=0.4
0 0 0 -1
h ( x ) sign ( 0 . 3 X 1 0 . 3 X 2 0 . 3 X 3 0 . 4 )
1 if x 0
where sign ( x )
1 if x 0
Input
Model is an assembly of nodes
inter-connected nodes and Black box
Output
weighted links X1 w1 node
w2
X2 hY (x)
Output node sums up w3
– X1 = 1, X2 = 0, X3 =1 => y = sign(0.2) = 1
02/14/2018 Introduction to Data Mining, 2nd Edition 10
Perceptron Learning Rule
Intuition:
– Update weight based on error: e yi f ( w( k ) , xi )
– If y=f(x,w), e=0: no update needed
– If y>f(x,w), e=2: weight must be increased so
that f(x,w) will increase
– If y<f(x,w), e=-2: weight must be decreased so
that f(x,w) will decrease
02/14/2018 Introduction to Data Mining, 2nd Edition 12
Example of Perceptron Learning
w ( k 1) w ( k ) y i f ( w ( k ) , x i ) x i
d
Y sign( wi X i )
i 0
0 .1
X1 X2 X3 Y w0 w1 w2 w3 Epoch w0 w1 w2 w3
1 0 0 -1 0 0 0 0 0 0 0 0 0 0
1 0 1 1 1 -0.2 -0.2 0 0 1 -0.2 0 0.2 0.2
2 0 0 0 0.2 2 -0.2 0 0.4 0.2
1 1 0 1
3 0 0 0 0.2
1 1 1 1 3 -0.4 0 0.4 0.2
4 0 0 0 0.2
0 0 1 -1 5 -0.2 0 0 0 4 -0.4 0.2 0.4 0.4
0 1 0 -1 6 -0.2 0 0 0 5 -0.6 0.2 0.4 0.2
0 1 1 1 7 0 0 0.2 0.2 6 -0.6 0.4 0.4 0.2
0 0 0 -1 8 -0.2 0 0.2 0.2
x1 x2 x3 x4 x5
Input
Layer Input Neuron i Output
I1 wi1
wi2 Activation
I2
wi3
Si function Oi Oi
Hidden g(Si )
Layer I3
threshold, t
XOR Data
y x1 x2
x1 x2 y
0 0 -1
1 0 1
0 1 1
1 1 -1
Various types of
activation functions (f)
h ( x) f ( wi X i )
i
The weight update formula used by the gradient descent method can
be written as follows: