Professional Documents
Culture Documents
Deep Learning: - Course Code: - Unit 1
Deep Learning: - Course Code: - Unit 1
• Course Code:
• Unit 1
Introduction to Deep learning
• Lecture 2
Perceptron
Human Brain Biological Neuron
𝑥0=1𝑤 0
• Perceptron is a building block of an
Artificial Neural Network
𝑤 Sum Activation • Neural Network comprising of a
𝑥1 1𝑛
𝑦 Single Neuron
∑ 𝑤 𝑖 𝑥𝑖
𝑖= 0
𝑥𝑛 𝑤 𝑛
𝑥1 𝑤 1 𝑦
𝑥 2 𝑤2
𝑥0=1
𝑥1 𝑦
𝑥2 2 Step Process
0 0 𝑥1 𝑤1 =1 𝑦 =𝑔 ( 𝑤0 𝑥0 +𝑤 1 𝑥 1+ 𝑤2 𝑥 2 )
0 1
1 0
𝑥 2 𝑤2 =1 Thresholding function
1 1
0 0 𝑥1 𝑤 1 =1 𝑦 =𝑔 ( 𝑤0 𝑥0 +𝑤 1 𝑥 1+ 𝑤2 𝑥 2 )
0 1
AND: 2D feature space
1 0
𝑥 2 𝑤 2 =1 Output : 0, :1
1 1
𝑥2
Shown data-points are
( 0 ,1 ) (1 , 1)
linearly separable
𝑥1
( 0 ,0 ) (1 , 0)
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Perceptron can Learn Simple Logic: AND
• AND Logic
𝑥0=1 𝑤 =−1.5 Activation function
0
0 0 𝑥1 𝑤 1 =1 𝑦 =𝑔 ( 𝑤0 𝑥0 +𝑤 1 𝑥 1+ 𝑤2 𝑥 2 )
0 1
AND: 2D feature space
1 0
𝑥 2 𝑤 2 =1 Output : 0, :1
1 1 𝑥2
( 0 ,1.5 )
( 0 ,1 ) (1 , 1)
Plot
Need to know only 2 points to plot a
straight line on 2D plane ( 1 , 0 ) 𝑥1
( 0 ,0 ) ( 1.5 , 0 )
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Perceptron can Learn Simple Logic: AND
• AND Logic
𝑥0=1 𝑤 =−1.5 Activation function
0
0 0 𝑥1 𝑤 1 =1 𝑦 =𝑔 ( 𝑤0 𝑥0 +𝑤 1 𝑥 1+ 𝑤2 𝑥 2 )
0 1
AND: 2D feature space
1 0
𝑥 2 𝑤 2 =1 Output : 0, :1
1 1 𝑥2
( 0 ,1.5 )
Perceptron acts as a
(1 , 1)
𝑦 =𝑔 ( 𝑤0 𝑥0 +𝑤 1 𝑥 1+ 𝑤2 𝑥 2 ) linear binary classifier ( 0 ,1 )
Class 1
Class 0 𝑥1
( 0 ,0 ) ( 1 , 0 )
( 1.5 , 0 )
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Q. Which logic does this perceptron learn?
Activation function
a) AND
𝑥0=1 𝑤 =− 0.50
b) OR 𝑥1 𝑤 1 =1 𝑦
c) NAND
d) NOR 𝑥 2 𝑤 2 =1
are either 0 or 1
a) AND
𝑥0=1 𝑤 =− 0.50
b) OR 𝑥1 𝑤 1 =1 𝑦
c) NAND
0 0
d) NOR 𝑥 2 𝑤 2 =1
0 1
1 0
1 1
are either 0 or 1
a) AND
𝑥0=1 𝑤 =− 0.50
b) OR 𝑥1 𝑤 1 =1 𝑦
c) NAND
0 0 0
d) NOR 𝑥 2 𝑤 2 =1
0 1 1
1 0 1
1 1 1
are either 0 or 1
OR logic
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Weights cause Learning !
AND OR NAND NOR
𝑥2 𝑥2 𝑥2 𝑥2
𝑥1
15
𝑥1 𝑥1
𝑥1
Amity Centre for Artificial Intelligence, Amity University, Noida, India
Can these be classified using a Linear Classifier ?
XOR XNOR
𝑥2 𝑥2 0 0 1
0 0 0
0 1 1 0 1 0
1 0 1 1 0 0
1 1 1
1 1 0
𝑥1 𝑥1
𝑥1
𝑥1 𝑥1 𝑥1