Professional Documents
Culture Documents
DNN - M1 - MLP As Universal Approximator
DNN - M1 - MLP As Universal Approximator
Deep Learning 2 / 50
Table of Contents
Deep Learning 3 / 50
Power of MLP
Deep Learning 4 / 50
MLP for XOR gate
1
x1 n1 1
1 1
-1 1 n3 2 x1 xor x2
-1
x2 n2 -1
Deep Learning 5 / 50
Perceptron with real inputs
x1 , . . . , xN are real valued.
W1 , . . . , WN are real valued.
Unit ”fires” if weighted input exceeds a threshold.
( P
1 if i wi xi ≥ T
ŷ =
0 otherwise
Deep Learning 6 / 50
Perceptron with real outputs
x1 , . . . , xN are real valued.
W1 , . . . , WN are real valued.
The output can also be real valued. – Sometimes viewed as the ”probability” of
firing.
Deep Learning 7 / 50
MLP for Complicated Decision Boundaries
Build a network of units with a single output that fires if the input is in the
coloured area.
Deep Learning 8 / 50
MLP for Complicated Decision Boundaries
x1 x2
Deep Learning 9 / 50
MLP for Complicated Decision Boundaries
x1 x2
Deep Learning 10 / 50
MLP for Complicated Decision Boundaries
x1 x2
Deep Learning 11 / 50
MLP for Complicated Decision Boundaries
x1 x2
Deep Learning 12 / 50
MLP for Complicated Decision Boundaries
x1 x2
Deep Learning 13 / 50
MLP for Complicated Decision Boundaries
Deep Learning 14 / 50
MLP for Complicated Decision Boundaries
P
i hi ≥ 5?
AND
h1 h2 h3 h4 h5
x1 x2
Deep Learning 15 / 50
MLP for Complicated Decision Boundaries
Network to fire if the input is in the yellow area.
I ”OR” two polygons
I A third layer is required
Deep Learning 16 / 50
MLPs for Complex Decision Boundaries
MLPs can compose arbitrarily complex decision boundaries with only one
hidden layer.
Deep Learning 17 / 50
MLPs for Arbitrary Classification Boundary
Just fit in an arbitrary number of circles
I More accurate approximation with greater number of smaller circles.
I Can achieve arbitrary precision
MLPs can capture any classification boundary.
Deeper networks can require far fewer neurons.
Deep Learning 18 / 50
MLP as Continuous-Valued Regression
A simple 3-unit MLP with a ”summing” output unit can generate a ”square
pulse” over an input.
I Output is 1 only if the input lies between T1 and T2.
I T1 and T2 can be arbitrarily specified
Deep Learning 19 / 50
MLP as Continuous-Valued Regression
A simple 3-unit MLP with a ”summing” output unit can generate a ”square
pulse” over an input.
An MLP with many units can model an arbitrary function over an input.
This generalizes to functions of any number of inputs.
Deep Learning 20 / 50
MLPs are Universal Boolean Functions
MLPs can compute more complex Boolean functions.
MLPs can compute any Boolean function; since they can emulate individual
gates.
Deep Learning 21 / 50
How many layers for a Boolean MLP?
Deep Learning 22 / 50
How many layers for a Boolean MLP?
Deep Learning 23 / 50
How many layers for a Boolean MLP?
Deep Learning 24 / 50
How many layers for a Boolean MLP?
Deep Learning 25 / 50
How many layers for a Boolean MLP?
Express any Boolean function in disjunctive normal form.
Deep Learning 26 / 50
How many layers for a Boolean MLP?
Express any Boolean function in disjunctive normal form.
Deep Learning 27 / 50
How many layers for a Boolean MLP?
Express any Boolean function in disjunctive normal form.
Deep Learning 28 / 50
How many layers for a Boolean MLP?
Deep Learning 29 / 50
How many layers for a Boolean MLP?
Express any Boolean function in disjunctive normal form.
Deep Learning 31 / 50
Reducing a Boolean Function
Use K-map to reduce the DNF to find groups and express as reduced DNF.
Deep Learning 32 / 50
Reducing a Boolean Function
Use K-map to reduce the DNF to find groups and express as reduced DNF.
Deep Learning 33 / 50
Largest Irreducible DNF?
What arrangement of ones and zeros simply cannot be reduced further?
Deep Learning 35 / 50
Width of a Single-Layer Boolean MLP
Deep Learning 42 / 50
Exercise
Deep Learning 43 / 50
Exercise - Solution
Deep Learning 44 / 50
Exercise
Deep Learning 45 / 50
Exercise - Solution
An XOR cannot be represented using a single perceptron as the XOR has non-linear
decision boundary. To represent non-linear decision boundary we need a multi-layer
perceptron with one hidden layers.
+1 +1 ak = sign(wk1 x1 + wk 2 x2 + b)
-10
-30
20 20 x1 x2 a1 a2 y
x1 a1 y
20 20 0 0 -10 ∼ 0 20 ∼ 1 -10 ∼ 0
20 -15
0 1 10 ∼ 1 5∼1 10 ∼ 1
-15
x2 a2 1 0 10 ∼ 1 5∼1 10 ∼ 1
1 1 30 ∼ 1 -30 ∼ 0 -10 ∼ 0
Deep Learning 46 / 50
Exercise
Deep Learning 47 / 50
Exercise - Solution
An XOR cannot be represented using a single perceptron as the XOR has non-linear
decision boundary. To represent non-linear decision boundary we need a multi-layer
perceptron with one hidden layers.
Traditional method:
I Number of variables n = 4
I Number of perceptrons = 2n − 1 = 24 − 1 = 15
Alternate method:
I Layer 1: A = W ⊕ X
I Layer 2: B = Y ⊕ Z
I Layer 3: C = A ⊕ B
Deep Learning 48 / 50
Exercise - Solution
W a1
a3
X a2 a7
a9
Y a4 a8
a6
Z a5
Deep Learning 49 / 50
Further Reading
2 http:
//mlsp.cs.cmu.edu/people/rsingh/docs/Chapter1_Introduction.pdf
3 http://mlsp.cs.cmu.edu/people/rsingh/docs/Chapter2_
UniversalApproximators.pdf
Deep Learning 50 / 50