1. University MCA (AI/ML) Semester 2
  2. CAB212
  3. Unit 2

CAB212 · Unit 2: Regression

Gradient descent and learning rate

8 practice questions

Key points

  • w := w - alpha * gradient
  • Large alpha can diverge; small alpha is slow
  • Mini-batch is the practical default
  • MSE for linear regression is convex

Gradient descent minimises a loss by repeatedly stepping against the gradient:

w := w - alpha * dL/dw, where alpha is the learning rate.

Worked example: w=2, gradient=4, alpha=0.1 gives w = 2 - 0.1*4 = 1.6.

  • alpha too small: very slow convergence.
  • alpha too large: overshoots, oscillates or diverges.
VariantData per updateNotes
BatchAll samplesStable, slow per step
Stochastic (SGD)One sampleNoisy, fast, can escape shallow minima
Mini-batchSmall batch (e.g. 32)Standard in practice

The MSE loss for linear regression is convex: one global minimum, so gradient descent converges to it with a suitable alpha. Feature scaling speeds convergence.

Exam pitfall: the gradient points uphill; we subtract it.

Try two questions

Question 1 · Tier 3, Apply

Why does feature scaling help gradient descent?

  1. It removes the need for any learning rate
  2. It turns the loss function non-convex
  3. It makes the loss surface more spherical so steps converge faster
  4. It makes the gradient grow to infinity
Show the answer

C. Similar feature ranges avoid elongated valleys.

Question 2 · Tier 4, Analyse

Mini-batch gradient descent is preferred in practice because it:

  1. Balances noisy updates, speed and hardware efficiency
  2. Uses zero memory during training
  3. Always converges in a single step
  4. Needs no learning rate at all
Show the answer

A. It trades off between batch stability and SGD speed.