All lessons in Machine Learning Engineering: Reliable Predictive Models

Gradients, Regularization, and Model Capacity

Trace parameter updates and use penalties to manage estimation variance.

30 minutes · Free with an account · preview

What you will learn

  • Compute a gradient step for an explicitly normalized objective.
  • Explain how a penalty changes the fitting objective without replacing validation.
  • Check a small analytic gradient with a central finite difference.

A model library hides a long sequence of parameter updates behind a fit call. Understanding one update helps diagnose failures that a different model name will not fix: an excessive learning rate, inconsistent loss normalization, badly scaled inputs or an incorrect derivative. Regularization adds a second question: how much training fit should the optimizer trade against a preference for smaller or simpler models?

Keep three objects separate. The training objective is the function the optimizer minimizes. The optimization algorithm is the procedure used to approach a minimum. The evaluation metric is the quantity used to compare the resulting predictions on held-out data. They may be related, but they do not have to be identical.

Choose another lesson