This looks like a textbook question until you realize they want the full chain: write out the MSE, differentiate with respect to both slope and intercept, then actually talk through SGD like you'd implement it, not just recite the update rule.
Start by formally defining the linear model and MSE loss, then derive gradients for both parameters using the chain rule, mirroring backpropagation. Next, outline the SGD algorithm with initialization and update rules, and finally discuss practical pitfalls like feature scaling and learning rate selection, including how to detect and address divergence.
Pro tip: Emphasize that feature scaling is crucial for SGD convergence; without it, the loss surface becomes elongated, causing slow convergence or divergence. Mention that monitoring the loss curve and using techniques like learning rate decay or adaptive optimizers can mitigate these issues.
State the linear model: y_pred = w * x + b. Define the MSE loss: L = (1/N) * sum((y_pred - y_true)^2).
Compute gradients of L w.r.t. w and b using the chain rule: dL/dw = (2/N) * sum((y_pred - y_true) * x), dL/db = (2/N) * sum(y_pred - y_true). Explain this as backpropagation through the computational graph.
Initialize w and b (e.g., zeros or small random values). For each epoch, shuffle data, iterate over mini-batches, compute gradients, and update: w = w - lr * dL/dw, b = b - lr * dL/db.
Address scaling: standardize features to zero mean and unit variance. Discuss divergence: if loss increases, reduce learning rate or use adaptive optimizers. Mention monitoring loss and early stopping.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.