The need for optimization

Nhập môn Deep Learning với Python

Dan Becker

Data Scientist and contributor to Keras and TensorFlow libraries

A baseline neural network

ch2_1_v3.002.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.003.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.004.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.005.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.006.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.007.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.008.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.009.png

Nhập môn Deep Learning với Python

A baseline neural network

ch2_1_v3.010.png

Nhập môn Deep Learning với Python

Predictions with multiple points

  • Making accurate predictions gets harder with more points
  • At any set of weights, there are many values of the error
  • ... corresponding to the many points we make predictions for
Nhập môn Deep Learning với Python

Loss function

  • Aggregates errors in predictions from many data points into single number
  • Measure of model's predictive performance
Nhập môn Deep Learning với Python

Squared error loss function

ch2_1_v3.019.png

Nhập môn Deep Learning với Python

Squared error loss function

ch2_1_v3.020.png

Nhập môn Deep Learning với Python

Squared error loss function

ch2_1_v3.021.png

Nhập môn Deep Learning với Python

Loss function

ch2_1_v3.023.png

Nhập môn Deep Learning với Python

Loss function

ch2_1_v3.024.png

Nhập môn Deep Learning với Python

Loss function

ch2_1_v3.025.png

Nhập môn Deep Learning với Python

Loss function

  • Lower loss function value means a better model
  • Goal: Find the weights that give the lowest value for the loss function
  • Gradient descent
Nhập môn Deep Learning với Python

Gradient descent

  • Imagine you are in a pitch dark field
  • Want to find the lowest point
  • Feel the ground to see how it slopes
  • Take a small step downhill
  • Repeat until it is uphill in every direction
Nhập môn Deep Learning với Python

Gradient descent steps

  • Start at random point
  • Until you are somewhere flat:
    • Find the slope
    • Take a step downhill
Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.042.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.044.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.045.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.046.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.047.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.048.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.049.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.050.png

Nhập môn Deep Learning với Python

Optimizing a model with a single weight

ch2_1_v3.051.png

Nhập môn Deep Learning với Python

Let's practice!

Nhập môn Deep Learning với Python

Preparing Video For Download...