Learning Rooms/□ Level 4 · Systems Engineer/Computing and algorithms
Gradient descent, how neural networks learn | Deep Learning Chapter 2
3Blue1Brown · Length: see YouTube · captions on YouTube · nothing loads until you press play
By the end you can…
- Compare grid search and gradient descent by evaluations needed and reliability.
- Carry out a gradient-descent step and explain the role of the learning rate.
- Recognise local minima and use restarts or coarse grids to guard against them.
Watch it all: no segment has been checked by hand for this video yet.
1.Predict before you press play
A grid search uses 20 values per parameter. How many simulations for a design with 4 parameters?
Pick one before you press play. A wrong guess is fine: it is what makes the video stick.
2.See the idea first
Play with this diagram for a minute. It gives you something to hang the video on.
Loading the interactive…
Can't use the diagram? Read a description instead
The explorer plots an illustrative cost against one design parameter x from 0 to 10, with a local valley near x = 2.3 (cost about 1.52), a ridge near 3.8, and the deepest valley near 7.4 (cost about 0.61). Gradient descent from x₀ = 1 ends in the shallow valley; from x₀ = 5 it reaches the deep one; with a learning rate above about 3 it overshoots. Grid search with k points evaluates the cost k times and finds the deep valley once the spacing is fine enough.
3.Watch, actively
The clearest picture of rolling downhill on a cost surface, and of why a step can land you in a local valley.
Length: see YouTube · captions on YouTube · source
Nothing loads from YouTube until you press play.
Watch for…
- → Watch the picture of a ball rolling on a cost surface; ignore the neural-network details and focus on what the gradient tells you.
- → Watch for the cost as a landscape and the gradient as the direction of steepest climb; training walks the other way.
- → Watch for how the cost surface's gradient tells each weight which way to move, and how big a nudge it gets.
Pause whenever you like. Rewatching a hard minute is a good habit, not a failure.
Can't stream it? Read the idea instead
Picture the cost of a design as a landscape. The gradient points uphill, so stepping a little in the opposite direction lowers the cost, and repeating that walks downhill. Step size matters, and you can stop in a local valley that is not the lowest one.
What the video covers (our own note, written when we verified it): The clearest picture of rolling downhill on a cost surface, and of why a step can land you in a local valley.
Written by Tactiverge in our own words, not a transcript. The full lessons below explain the idea without the video.
Jot down one thing that surprised you and one question you still have.
4.Practise what you just saw
These come from the lessons that use this video and are checked on the server. Wrong answers get a hint and another try.
Practice 1 · a fresh version every time
You grid-search a design with 4 parameters, trying 5 values of each. One simulation takes 0.01 s. How long does the full grid take, in seconds?
Practice 2
What is the slope σ'(z) = σ(z)(1 − σ(z)) of the sigmoid at z = 0?
Practice 3 · a fresh version every time
Minimise f(x) = 0.5(x − 3)² by gradient descent with learning rate η = 0.05, starting from x₀ = -4. What is x after 5 steps?
Practice 4
Gradient descent's cost goes up and down and then grows each step. What is the most likely cause?
5.Try it yourself
No simulation models this idea yet. The lessons below have an interactive diagram instead.
6.Build something with it
Follow-up project
In the greenhouse Build Level 4, treat (setpoint, Kp) as design variables and energy as the cost subject to the comfort constraint. Do a 5 × 5 grid, then refine around the best point by hand-stepping downhill. Report evaluations used and best found.
Where this video lives
- Searching a design landscape: grids, gradients and local minima · Level 4, week 30
- Gradient descent on a one-neuron network · Level 5, week 23
- Gradient descent and the learning rate · Level 5, week 25
In the course catalogue: CSE-420 Optimisation and computational trade-offs · CSE-510 Numerical solvers and complexity · AIP-520 Embedded machine learning
The video is by 3Blue1Brown, embedded from YouTube with privacy-enhanced mode and never autoplayed. The room around it (prompts, notes, practice, projects) is Tactiverge's, written with AI assistance and checked by automated tests only.