Backpropagation
TJ Machine Learning
TJ Machine Learning Club
Slide 1
Review
TJ Machine Learning Club
Slide 2
The Perceptron
Weights
Bias
TJ Machine Learning Club
Slide 3
Today’s Goal
Weights
Bias
TJ Machine Learning Club
Slide 4
Error for a very simple function
We can construct a graph of the loss
(3, 220)
TJ Machine Learning Club
Slide 5
Minimizing Error: Gradient Descent
TJ Machine Learning Club
Slide 6
The Intuitive Explanation
Direction we push the weight
TJ Machine Learning Club
Slide 7
The Gradient
Gradients
(also called a derivative)
Subtraction gives us descent
TJ Machine Learning Club
Slide 8
The Gradient as Slope
TJ Machine Learning Club
Slide 9
The Intuitive Explanation
TJ Machine Learning Club
Slide 10
The Learning Rate
TJ Machine Learning Club
Slide 11
Optimizing the Learning Rate
TJ Machine Learning Club
Slide 12
TJ Machine Learning Club
Slide 13
Calculating One Neural Network Iteration
n1
n2
n3
n4
n5
n6
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W36
W36 = W36 - α
TJ Machine Learning Club
Slide 14
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W36
W36 = W36 - α
TJ Machine Learning Club
Slide 15
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
E = ½(n6 - y)2
n6 = W36n3 + W46n4 + W56n5
=
TJ Machine Learning Club
Slide 16
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
E = ½(n6 - y)2
n6 = W36n3 + W46n4 + W56n5
W36 = W36 - α
W36 = -1 - 0.1(12) = -1 - 1.2 = -2.2
= (n6 - y) * n3 = -4 * -3 = 12
=
TJ Machine Learning Club
Slide 17
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W13
W13 = W13 - α
TJ Machine Learning Club
Slide 18
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W13
W13 = W13 - α
=
TJ Machine Learning Club
Slide 19
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W13
W13 = W13 - α
=
E = ½(n6 - y)2
n6 = W36n3 + W46n4 + W56n5
n3 = W13n1 + W23 + n2
TJ Machine Learning Club
Slide 20
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = 1
W36 = -1
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
Goal: Update W13
W13 = W13 - α
=
(n6 - y) * W36 * n1
=
(-4) * -1 * 3 = 12
W13 = 1 - 0.1 * 12 = -0.2
TJ Machine Learning Club
Slide 21
Calculating One Neural Network Iteration
3
-2
-3
8
13
5
W13 = -0.2
W36 = -2.2
W23 = 3
W14 = 4
W15 = 3
W24 = 2
W25 = -2
W56 = 2
W46 = -3
Linear Activation Function (y = x) and no biases, n1 = 3, n2 = -2, y = 9, α = 0.1
TJ Machine Learning Club
Slide 22