Source: Annotated lecture PDF. Page references use PDF page numbers.
Overview
- Positive definiteness describes the sign of quadratic forms.
- Optimisation seeks good parameters; stationarity alone does not certify a minimum.
- Least squares has a closed-form solution under a rank condition; logistic regression motivates iteration.
- Gradient descent combines a direction, a step size and a stopping rule.
Positive definite and positive semidefinite matrices
For a real symmetric matrix ,
This is a property of the quadratic form, not a requirement that every matrix entry be positive.
Key takeaway: is a dot product. For a positive definite matrix, and make an acute angle: this is the slide’s “same side” intuition. In Taylor’s quadratic term, the same expression describes curvature along a displacement.
Optimisation setup
Unconstrained optimisation minimises over . Constrained optimisation restricts to a feasible region, for example using and . The lecture assumes at least , sometimes .
For model training, the decision variables are the model parameters, while the training data are fixed. An example objective is average squared prediction error:
Source: pp. 4–5.
Stationary points and minima
- Local minimum: for all in some neighbourhood of .
- Global minimum: the inequality holds throughout the domain.
- Stationary point: .
First-order necessary condition: an unconstrained local minimiser of a differentiable function satisfies . This condition alone also admits maxima and stationary points that are not extrema. Do not apply it blindly to constrained boundary minima.
Key takeaway: a zero slope cannot classify a point. The diagram groups several stationary behaviours; additional structure or curvature information is needed. For a differentiable convex objective on , a stationary point is a global minimiser.
Worked example: least squares
With training examples as rows of and targets in ,
Setting the gradient to zero gives the normal equations:
If has full column rank, is invertible and
Include a column of ones in if fitting an intercept. The objective is convex because its Hessian is ; full column rank makes it positive definite and the minimiser unique. If the rank condition fails, the inverse formula is unavailable and minimisers need not be unique.
Source: scalar derivation, p. 10 and matrix formulation, p. 11. Remember the normal equations and rank assumption rather than every expanded scalar term.
Logistic regression: from likelihood to loss
For binary targets , define
The probability assigned to the observed label is . Under the lecture’s independent-observation assumption, the likelihood is the product of these terms.
Key takeaway: logarithms turn the product into a sum and preserve its maximiser because log is strictly increasing. Negating and averaging gives the negative log-likelihood / binary cross-entropy:
This avoids directly multiplying many tiny probabilities. Unlike least squares, the stationarity equations generally have no simple closed-form solution, so we optimise iteratively. The gradient simplifies to
This is an equivalent form of the gradient on p. 22: each example contributes prediction error multiplied by its features.
Gradient descent
A descent direction decreases for every sufficiently small positive . For differentiable , is sufficient.
From the directional derivative, the negative gradient is the Euclidean steepest descent direction. The standard update is
Even with fixed learning rate , the actual movement has length . A downhill direction guarantees improvement only for sufficiently small steps: an excessive step can overshoot.
Stop using a criterion such as and a hard iteration/computation limit. A small gradient signals approximate stationarity, not proof of a global minimum. Initialisation can affect the outcome for nonconvex problems.
Choosing the next iterate
Line search versus trust region, p. 26:
- Line search: choose a direction first, then choose how far to move along it.
- Trust region: set a radius, then optimise a local model within that radius to choose the step.
The lecturer’s practical emphasis on pp. 24–25 is to compare total computational cost. Fewer iterations may require more expensive information per iteration. The practical goal is a sufficiently good point within the available budget.
Important results
- is necessary for an unconstrained differentiable minimum, but generally insufficient.
- Least squares: ; the inverse formula requires full column rank.
- Logistic loss gradient: .
- Gradient descent: .