Lesson 2 of 7 · 2 min
What is Gradient Descent?
Analogy: Imagine you're blindfolded on a hilly landscape and want to find the lowest valley. You can't see, but you can feel the slope under your feet. Each step: feel which direction goes downhill, take a small step that way. Repeat until you stop going down. That's gradient descent — find the minimum of a function by following the slope downward.
In ML: The "landscape" is the loss function (how wrong the model is). The "valley" is minimum loss = best model parameters.
Formula:
m_new = m_old - learning_rate × ∂Loss/∂m b_new = b_old - learning_rate × ∂Loss/∂b
Where:
∂Loss/∂m = -(2/n) × Σ xᵢ(yᵢ - ŷᵢ) ∂Loss/∂b = -(2/n) × Σ (yᵢ - ŷᵢ) Loss = (1/n) × Σ (yᵢ - ŷᵢ)² ← Mean Squared Error
