Artificial Neural Networks - 2
Artificial Neural Networks - 2
• Perceptron Model
𝑔 𝑥1 , 𝑥2 , … , 𝑥𝑛 = 𝑔 𝒙 = 𝑤𝑖 𝑥𝑖
𝑖=1
• Threshold
1 𝑖𝑓 𝑔(𝑥) ≥ 𝜃
𝑦=𝑓 𝑔 𝒙 =
0 𝑔(𝑥) < 𝜃
• Weight updating
𝑤𝑖 = 𝑤𝑖 + 𝑐 𝑡 − 𝑓(𝑔(𝑥) 𝑥𝑖
Dr. Mainak Biswas
Perceptron Rule Example
• Assume a 3 input perceptron plus bias (it outputs 1 if net > 0, else 0)
CS 472 - Perceptron 6
Example
• Assume a 3 input perceptron plus bias (it outputs 1 if net > 0, else 0)
CS 472 - Perceptron 8
Training
• Assume a 3 input perceptron plus bias (it outputs 1 if net > 0, else 0)
• Assume a learning rate c of 1 and initial weights all 0: Dwi = c(t – z) xi
• Training set
X3 X2 X1 X0 Y
0 0 1 1 0
1 1 1 1 1
1 0 1 1 1 0 1 1 1-> ?
0 1 1 1 0 1000
Pattern Target Weight Vector Net Output DW ______
001 1 0 0000 0 0 0 0 0 0
EPOCH 1
111 1 1 1000 1 1 0 0 0 0
101 1 1 1000 1 1 0 0 0 0
011 1 0 1000 0 0 0 0 0 0
CS 472 - Perceptron 9
Assignment
• Generate the training epochs using
perceptron model from the training data
0 1 10 -> 1
1 0 1 1-> 0
1 0 0 1-> 1
0 1 0 0-> 0