1.
4
The First Machine Learning Classi er
Part 2: Making Predictions
Sebastian Raschka and the Lightning AI Team
fi
Measurement 2
Measurement 1
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
How do we learn the decision boundary?
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
How do we learn the decision boundary?
We use a machine learning algorithm!
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
The Perceptron
One of the earliest machine learning algorithms
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
The Perceptron
One of the earliest machine learning algorithms
Sebastian Raschka Deep Learning Fundamentals, Unit 1
https://upload.wikimedia.org/wikipedia/en/thumb/5/52/Mark_I_perceptron.jpeg/220px-Mark_I_perceptron.jpeg
Lightning AI
Inspired by Neurons in the Human Brain
https://commons.wikimedia.org/wiki/Neuron#/media/File:Pyramidal_hippocampal_neuron_40x.jpg
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
But it is not actually how the human brain works
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Sebastian Raschka Deep Learning Fundamentals, Unit 1
Source: https://media.mnn.com/assets/images/2016/10/plane-birds.jpg.1000x0_q80_crop-smart.jpg
Lightning AI
Perceptron Structure
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Structure
Inputs
Outputs
(predictions)
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Inputs
Outputs
(predictions)
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
Inputs
x1
Outputs
(predictions)
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
Inputs
x1
x1
Outputs
(predictions)
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
Inputs
x1
x1
Outputs
(predictions)
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
1.1
Outputs
(predictions)
5.5
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
1.1
Outputs
5.5 want:
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
x1
Outputs
(predictions)
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
x1
Compute
value Outputs
x2
z (predictions)
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
x1
Compute
If z > 0
z
value
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2
x1
x1
Compute
If z > 0
z
value
else
if z ≤ 0
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
b
x1
w1 Compute
If z > 0
z
value
w2
else
if z ≤ 0
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1
Compute
If z > 0
z
value
w2
else
if z ≤ 0
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1 + x2 × w2
Compute
If z > 0
z
value
else
if z ≤ 0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1 + x2 × w2 + b
Compute
If z > 0
z
value
else
if z ≤ 0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1 + x2 × w2 + b =z
Compute
If z > 0
z
value
else
if z ≤ 0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1 + x2 × w2 + b =z
x1 × w1 + x2 × w2 + . . . + xm × wm + b = z
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Model parameters to compute value z
x1 × w1 + x2 × w2 + b =z
x1 × w1 + x2 × w2 + . . . + xm × wm + b = z
∑
=b+ xi × wi
i=1
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Summary for Making Predictions
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Summary for Making Predictions
Inputs
x1
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Summary for Making Predictions
Inputs Computation
b
x1
w1
Weighted
w2 sum
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Summary for Making Predictions
Inputs Computation
b
x1
w1
Weighted
w2
Threshold
sum
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Perceptron Summary for Making Predictions
Inputs Computation Outputs
b
x1
w1
Weighted
w2
Threshold
sum
x2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
How does the perceptron learn
the model parameters?
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI