From drawing triangles to gradient descent
Draw y = x². At x = 2, draw a tiny triangle with run = 0.1. Calculate the slope (rise/run). Try smaller runs to see what happens.
Draw y = x². At x = 2, draw a tiny triangle with run = 0.1. Calculate the slope (rise/run). Try smaller runs to see what happens.
Click blocks to stack them.
# generated Python appears here
Output appears here.
Watch the Gradient Descent Hiker! Start at any point on a 2D terrain. The hiker uses the slope (derivative) to walk downhill. Adjust learning rate to see if they converge or overshoot!
Hiker ends near x = 6.00 (valley is x = 6)