1.2 Why Vector Calculus
Training is an optimization problem. Linear regression is the first example.
These notes walk through the lecture slides. The original deck is unchanged; use (slides) on the course hub if you want that PDF.
The figures follow Deisenroth, Faisal, and Ong, Mathematics for Machine Learning.
1. Training is optimization
Many algorithms in this course optimize an objective with respect to model parameters that control how well the model explains the data. Finding good parameters is an optimization problem. Three pictures you will see again:
- Linear regression. are weights. Maximize a likelihood, or minimize squared error.
- Auto-encoders (Module 6). are layer weights and biases. Minimize reconstruction error by repeated application of the chain rule.
- Gaussian mixtures (Module 5). are means, shapes, and mixture weights. Maximize the likelihood. Used in clustering and anomaly detection.
We write the objective as . Training is
If you cannot write and say what is, you do not yet have a learning problem.
2. Linear regression, written so the calculus is visible
Training pairs , . The prediction model is
Estimate by minimizing squared error
To minimize , solve . In matrix form that is the normal equation
when is invertible. The inverse existing is a linear-algebra fact (full column rank). The step is calculus.
For two weights the surface is a convex bowl. One local minimum, and it is global.

Neural nets will not be this kind.
3. A map of the math
The next figure is the course’s reminder of which math shows up where. Module 1 lives in the vector-calculus and optimization blocks. Later modules reuse the same objects (gradients, Hessians, inner products, eigenvalues) on new models.

To minimize a smooth you need:
- a gradient (first derivatives) — when to stop, which way is downhill;
- a Hessian (second derivatives) — how curved the bowl is;
- later, constraints (Week 3) when is not free in .
The next two notes are those derivatives. Week 2 turns them into algorithms.
4. Practice
-
Why is the normal equation a calculus problem, not a programming problem?
-
In the auto-encoder example, what is , and why does the chain rule appear?
-
If is not invertible, what did the data do, and what do you change before you invert?