Module 3 · Lesson 2 of 511/56 in the course~22 min
Module lessons (2/5)
Gradient descent
Lesson preview5 hands-on exercises readyMachine Learning: from first principles to practice · Module 3 — Linear regression and gradient descent
Step downhill on the loss, and the effect of the learning rate.
What you'll learn in this lesson
- Explain gradient descent as repeatedly stepping downhill on the loss.
- Implement one update step for a line.
- Recognise a learning rate that is too small, good or too large.
Overview
You cannot see the whole loss surface, but you can feel which way the ground slopes under your feet. Gradient descent repeats one simple move: look at the slope of the loss with respect to each parameter, and take a small step in the downhill direction. Do it enough times and you reach the bottom.
For each parameter, subtract the learning rate times the gradient (the slope of the loss for that parameter):
Sections covered in this lesson
- 1The hook: finding the bottom of a valley in the fog
- 2The update rule
- 3Try it: run gradient descent
- 4In code: stepping downhill progressively
- 5Practice
- 6Check your understanding
Pro Lesson · Module 3 — Linear regression and gradient descent
Unlock "Gradient descent" and the full Machine Learning: from first principles to practice curriculum
Step downhill on the loss, and the effect of the learning rate.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.