Amrutha
Course Content Developer for Deep Learning course by Professor Mitesh Khapra. Offered by IIT Madras Online degree - Programming and Data Science.
Department of Computer Science and Engineering, IIT Madras
Artificial Neuron
x1
w1
x2
x3
y1
σ
w2
w3
https://cdn.vectorstock.com/i/composite/12,25/neuron-cell-vector-81225.jpg
soma
dendrite
axon
synapse
fires if visual is funny
fires if speech style is funny
fires if text is funny
fires if at least 2 of 3 inputs fired
________________________________________
face
nose
mouth
eyes
y=f(g(x))=1 if g(x)≥ θ
=0 if g(x)< θ
A McCulloch Pitts unit
3
1
0
1
0
AND function
OR function
NOT function
NOR function
x1 AND !x2*
1
OR function
2
AND function
0
Tautology (always ON)
1
OR
x1+x2+x3=θ=1
x2
x1
x3
(0,1,1)
(0,1,0)
(1,1,0)
(1,0,0)
(0,0,0)
(1,1,1)
(0,0,1)
(1,0,1)
x1
w1
x2
xn
y
w2
wn
..
..
..
..
x1
w1
x2
xn
w2
wn
..
..
..
..
y
x0=1
w0=−θ
x1
w1
x2
y
w2
w3
x0=1
w0=−θ
x3
x1
w1
x2
y
w2
w3
x0=1
w0=−θ
x3
McCulloch Pitts Neuron
Perceptron
x1
x2
OR
0
1
0
1
0
0
1
1
0
1
1
1
−1
−1
3
1.5
0
1
0.45
0.45
3
...
...
(scaled to 0 to 1)
(scaled to 0 to 1)
w1
w2
wn
..
..
w0=−θ
x1
x2
xn
y
..
..
x0=1
P← inputs with label 1;
N← inputs with label 0;
Initialize w randomly;
while !convergence do
Pick random x ∈ P ∪ N ;
w = w + x ;
end
end
//the algorithm converges when all the inputs
are classified correctly
if x ∈ P and ∑i=0n wi∗xi <0 then
end
if x ∈ N and ∑i=0n wi∗xi ≥0 then
w = w − x ;
(∵ cosα= ∥w∥∥x∥wTx = 0)
y=1 if wTx≥0
=0 if wTx<0
x2
x1
p2
p3
w
p1
n1
n2
n3
P← inputs with label 1;
N← inputs with label 0;
Initialize w randomly;
while !convergence do
Pick random x ∈ P ∪ N ;
w = w + x ;
end
end
//the algorithm converges when all the inputs
are classified correctly
if x ∈ P and ∑i=0n wi∗xi <0 then
end
if x ∈ N and ∑i=0n wi∗xi ≥0 then
w = w − x ;
P← inputs with label 1;
N← inputs with label 0;
Initialize w randomly;
while !convergence do
Pick random x ∈ P ∪ N ;
w = w + x ;
end
end
//the algorithm converges when all the inputs
are classified correctly
if x ∈ P and ∑i=0n wi∗xi <0 then
end
if x ∈ N and ∑i=0n wi∗xi ≥0 then
w = w − x ;
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
x2
x1
p2
p3
p1
n1
n2
n3
N← inputs with label 0;
Initialize w randomly;
while !convergence do
Pick random p ∈ P′
w = w + x ;
end
end
//the algorithm converges when all the inputs are classified correctly
if x ∈ P and ∑i=0n wi∗xi <0 then
N− contains negations of all points in N;
P′←P∪N
p← ∥ p∥p (so now, ∥p∥=1
Setup
//notice that we do not need the other if condition
because by construction we want all points in P′ to lie
P← inputs with label 1;
Proof:
Observations:
Proof (continued):
Proof (continued):
x1
x2
XOR
0
1
0
1
0
0
1
1
0
1
1
0
x2
x1
(0,0)
(1,0)
(0,1)
(1,1)
x1
x2
0
0
1
0
0
1
1
1
0
1
1
0
0
1
1
0
0
1
0
1
0
0
1
1
0
1
1
0
0
1
1
0
0
1
0
1
0
0
1
1
0
1
1
0
0
1
1
0
0
1
0
1
0
0
1
1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
f1
f2
f3
f4
f5
f6
f7
f8
f9
f10
f11
f12
f13
f14
f15
f16
x1
x2
y
bias=−2
w1
w2
w3
w4
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
1,-1
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
1,-1
1,1
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
1,-1
1,1
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
1,-1
1,1
x1
x2
XOR
0
0
0
x1
x2
1
0
h1
h2
0
0
h3
h4
∑i=14 wihi
w1
1
0
1
0
1
0
0
w2
0
1
1
0
0
1
0
w3
1
1
0
0
0
1
1
w4
-1,-1
x1
x2
y
bias=−2
w1
w2
w3
w4
h1
h2
h3
h4
-1,1
1,-1
1,1
w1
w2
w3
w4
x2
x1
x1
y
w5
w6
w7
w8
bias=−3
y
w1
w2
w3
w4
w5
w6
w7
w8
bias=−3
x1
x2
x3
By Amrutha