Key points, notes and past questions
Taylor, Optimality and Gradient Descent
Local approximation, optimality tests and gradient descent, which later ML models rely on.
- Taylor series
- Coefficient $=f^{(k)}(a)/k!$.
- Derivative $=k!\times$ coefficient.
- Powers are of $(x-a)$.
- Taylor approximation
- $d$ = new minus old.
- Keep the $\tfrac12$.
- First-order change is $\nabla f^Td$.
- Exact for quadratics at second order.
- Optimality tests
- Zero gradient is necessary.
- PD Hessian is sufficient for a strict local minimum.
- Indefinite means saddle.
- An increasing outer function keeps the minimiser.
- Closest point problems
- Minimise squared distance.
- Substitute using the curve; keep the range.
- Segment is perpendicular to the tangent.
- Applied problems with constraints
- Objective, constraint, substitute, range, differentiate, check.
- Answer the quantity that is asked.
- Inscribed circle: nearest boundary distance.
- Gradient descent steps
- $x_{t+1}=x_t-\eta_t\nabla f(x_t)$.
- Recompute the gradient every step.
- Check where $t$ starts.
- Update all coordinates together.
- Choosing the step size
- $x_{t+1}=(1-2a\eta)x_t$ on $ax^2$.
- Converges for $0<\eta<1/a$.
- One step at $\eta=1/(2a)$.
- Tiny steps stay in the nearby valley.
- Extra: convexity
- Convex: graph below chords.
- PSD Hessian everywhere.
- Local minimum is global.