Skip to main content

Unconstrained Optimization

Formulation, Algorithms, and Non-Smooth Methods

This page covers the foundations of unconstrained optimization, ranging from basic optimality conditions and least squares to advanced descent algorithms (Newton, SGD, Adam) and non-smooth techniques like Proximal Gradient Descent.

Source

Based on the course "Unconstrained optimization" by Pr. Pierre Hellier (Université de Rennes / Inria).

1. Formulation and Optimality

The goal is to find a vector xx^* that minimizes a loss function L(x)L(x) over the entire domain Rn\mathbb{R}^n.

x=argminxRnL(x)x^* = \arg \min_{x \in \mathbb{R}^n} L(x)

Optimality Conditions

To identify potential minima, we analyze derivatives.

  1. First-Order Necessary Condition If xx^* is a local minimum, the gradient must be zero (stationary point):

    F(x)=0{ \nabla F(x^*) = 0 }
  2. Second-Order Sufficient Condition If F(x)=0\nabla F(x^*) = 0 and the Hessian matrix H(x)H(x^*) is positive definite, then xx^* is a strict local minimum.

    H(x)=2F(x)=(2Fx122Fx1xn2Fxnx12Fxn2)H(x) = \nabla^2 F(x) = \begin{pmatrix} \frac{\partial^2 F}{\partial x_1^2} & \dots & \frac{\partial^2 F}{\partial x_1 \partial x_n} \\ \vdots & \ddots & \vdots \\ \frac{\partial^2 F}{\partial x_n \partial x_1} & \dots & \frac{\partial^2 F}{\partial x_n^2} \end{pmatrix}
Convexity

If the function FF is convex, any local minimum is automatically a global minimum.

2. Least Squares Problems

A classic optimization problem involves predicting a target yy from features AA via a linear model AxyAx \approx y.

Ordinary Least Squares (OLS)

Minimize the sum of squared errors:

F(x)=Axy2F(x) = \|Ax - y\|^2

Analytic Solution: The gradient is F(x)=2ATAx2ATy\nabla F(x) = 2A^T A x - 2A^T y. Setting it to zero yields the Normal Equations:

x=(ATA)1ATyx^* = (A^T A)^{-1} A^T y

Regularized Least Squares

To prevent overfitting or handle ill-posed problems (m<nm < n), we add a penalty term R(x)R(x).

Minimizes Axy2+λx22\|Ax - y\|^2 + \lambda \|x\|_2^2.

Solution: (ATA+λI)1ATy(A^T A + \lambda I)^{-1} A^T y

Shrinks coefficients towards zero, handling multicollinearity and invertibility issues.

3. Descent Algorithms

Iterative methods update the solution step-by-step:

xk+1=xk+αkdkx_{k+1} = x_k + \alpha_k d_k

where dkd_k is the descent direction and αk\alpha_k is the step size (learning rate).

Gradient & Newton Methods

MethodDirection dkd_kComplexityConvergence
Gradient DescentL(xk)-\nabla L(x_k)O(n)\mathcal{O}(n)Linear
Newton's MethodH(xk)1L(xk)-H(x_k)^{-1} \nabla L(x_k)O(n3)\mathcal{O}(n^3)Quadratic
Quasi-Newton (BFGS)Bk1L(xk)-B_k^{-1} \nabla L(x_k)O(n2)\mathcal{O}(n^2)Superlinear
Step Size Strategies
  • Fixed: Simple but sensitive (too small = slow, too large = diverge).
  • Lipschitz: α=1/K\alpha = 1/K if gradient is KK-Lipschitz.
  • Line Search: Backtracking to satisfy Wolfe conditions (ensure sufficient decrease).

Stochastic Gradient Descent (SGD)

When data size mm is huge, computing the full gradient is expensive. SGD approximates it using a single sample (or mini-batch).

xk+1=xkαL(f(Xi),Yi)x_{k+1} = x_k - \alpha \nabla \mathcal{L}(f(X_i), Y_i)

Advanced Optimizers

  • Momentum: Adds a "velocity" term to smooth oscillations and accelerate convergence.
  • RMSProp: Adapts learning rates based on moving average of squared gradients.
  • Adam: Combines Momentum and RMSProp. State-of-the-art for Deep Learning.

4. Non-Smooth Optimization

When the objective includes non-differentiable terms (like Lasso's L1 norm), standard gradient descent fails. We use Proximal methods.

Proximal Operator

The proximal operator maps a point to a nearby location that minimizes the non-smooth function gg:

proxλg(v)=argminx(g(x)+12λxv2)\text{prox}_{\lambda g}(v) = \arg \min_x \left( g(x) + \frac{1}{2\lambda} \|x - v\|^2 \right)

For Lasso (g(x)=x1g(x) = \|x\|_1), this is the Soft Thresholding operator:

Sλ(v)=sign(v)max(vλ,0)S_\lambda(v) = \text{sign}(v) \max(|v| - \lambda, 0)

Algorithms

ISTA (Iterative Soft-Thresholding Algorithm)

Combines a gradient step on the smooth part (ff) with a proximal step on the non-smooth part (gg).

xk+1=proxαg(xkαf(xk))x_{k+1} = \text{prox}_{\alpha g}(x_k - \alpha \nabla f(x_k))

FISTA (Fast ISTA)

Applies Nesterov's acceleration to ISTA, achieving significantly faster convergence (O(1/k2)\mathcal{O}(1/k^2) vs O(1/k)\mathcal{O}(1/k)).

yk+1=xk+tk1tk+1(xkxk1)xk+1=proxαg(yk+1αf(yk+1))\begin{aligned} y_{k+1} &= x_k + \frac{t_k - 1}{t_{k+1}}(x_k - x_{k-1}) \\ x_{k+1} &= \text{prox}_{\alpha g}(y_{k+1} - \alpha \nabla f(y_{k+1})) \end{aligned}