Terminology¶
General Form of an Optimization Problem:
: decision variable
: objective function
: feasible set (constraints)
Feasible point: a decision variable that satisfies the constraints.
Feasible set (or feasible region) : the set of all feasible points.
Optimal solution: a feasible point whose objective value is at least as that of any other feasible point.
Optimal value:
If there exists such that , then the optimal value is said to be attainable.
If (no constraints), the problem is called unconstrained; otherwise, it is a constrained optimization problem.
Local minimizers. A point is called:
a local minimizer if there exists such that for all ;
a strict local minimizer if for all .
Global minimizers. A point is called:
a global minimizer if for all ;
a strict global minimizer if for all .
Stationary point (or critical point): a point where the gradient of the objective function is zero, i.e., .
Saddle point: a stationary point that is neither a local minimum nor a local maximum.
Optimality Conditions¶
Unconstrained Optimization¶
FONC (First-Order Necessary Condition): If is differentiable and is a local minimizer of , then .
SONC (Second-Order Necessary Condition): If is twice differentiable and is a local minimizer of , then and is positive semi-definite.
SOSC (Second-Order Sufficient Condition): If is twice continuously differentiable and satisfies and is positive definite, then is a strict local minimizer.
Sufficient Condition for Saddle Points: If and is indefinite, then is a saddle point.
Constrained Optimization¶
Definitions:
Feasible direction: Given , a direction is called a feasible direction at if .
Descent direction: Let be continuously differentiable. A direction is called a descent direction at if .
Note: by Taylor’s expansion, will decrease the function value if step size is small enough.
FONC (First-Order Necessary Condition): Let be a local minimizer of . Then, for any feasible direction at , we have .
There are no feasible descent directions at a local minimum.
In the unconstrained case, all directions are feasible, so .
Lagrangian
Problem setup:
Feasible set: .
Active constraints: .
Inactive constraints: .
Lagrangian function:
where are the Lagrange multipliers for the inequality constraints and are the Lagrange multipliers for the equality constraints.
KKT Conditions: Let be a local mimimizer, and assume a constaint qualification holds. Then there exist and such that:
Stationarity: .
Primal feasibility: for all , and for all .
Dual feasibility: for all .
Complementarity: for all .
LICQ (Linear Independence Constraint Qualification): The gradients of the active constraints at are linearly independent, i.e., are linearly independent. (This is one of the constraint qualifications.)
A feasible point satisfying the KKT conditions is called a KKT point.
Convexity¶
Definitions:
A set is convex if for any and , we have .
A function is convex if for any in its domain and , we have .
A function is concave if is convex.
A function is strictly convex if the inequality is strict for and .
A function is strongly convex with parameter if
for all in its domain and .
Second-Order Characterization: Let be twice differentiable on a convex open set . Then is convex on if and only if its Hessian is positive semi-definite for all .
First-Order Characterization: Let be differentiable on a convex open set . Then is convex on if and only if , we have
First-Order Characterizations of Convexity
Strictly Convex Function: The function is strictly convex if and only if , we have
Strongly Convex Function: The function is strongly convex with parameter if and only if , we have
Second-Order Characterizations of Convexity
Strictly Convex Function: The function is strictly convex if is positive definite for all .
Strongly Convex Function: The function is strongly convex with parameter if and only if for all ,
Convex Calculus:
Sum Rule: If and are convex functions, then is also convex.
Composition with Linear Functions: If is convex and , then is convex.
Maximum of Convex Functions: If are convex functions, then is also convex.
Composition Rule: Let be a convex set. Suppose is a convex function and is convex and non-decreasing on an interval . Then the composition is convex.
Convex Constraint
A constraint is called convex if the feasible region defined by the constraint is a convex set.
Sufficient conditions for convex constraints:
Constraints of the form with convex.
Linear constraints:
Any combination of convex constraints.
Convex Optimization Problem: An optimization problem is called a convex optimization problem if the objective function is convex or concave (for maximization) and the feasible set defined by the constraints is a convex set.
Convexity and Global Solutions: If is convex on a convex set , then any local minimizer of is also a global minimizer.
Stationarity and Optimality: If is convex and differentiable, then
Remarks:
For unconstraint convex problems, FONC is both necessary and sufficient for global optimality.
Finding stationary points is enough to find global solutions.
Global Optimality of KKT Points:
Consider the convex optimization problem
where and are convex functions, and are linear. Then any KKT point is a global minimizer.
Remarks:
No constraint qualification is needed for this theorem.
Algorithms¶
Gradient Descent¶
Consider the unconstrained optimization problem .
Gradient descent iteration:
The update direction is a descent direction, since for .
The step size can be chosen by various methods, such as:
Constant step size: for some fixed .
Diminishing step size: as , e.g., .
Line search: choose to minimize over .
Adaptive step size: methods like AdaGrad, RMSProp, Adam, etc., which adjust the step size based on past gradients.
A commonly used stopping criterion is , where is a prescribed tolerance level.
Theorem: Gradient Descent for Strongly Convex Functions
Assume that is -strongly convex and has -Lipschitz continuous gradients (). Using a constant step size , the gradient descent iterates satisfy
where is the unique global minimizer of .
Consequently, after iterations,
Note: Number of iterations to achieve -accuracy (i.e., ) will be .
Convex and Smooth Case
Let be convex and have -Lipschitz continuous gradients. Using a constant step size , the gradient descent iterates satisfy
convergence rate
To find such that , it is enough to run iterations.
Nonconvex and Smooth Case
Let have -Lipschitz continuous gradients (not necessarily convex). With the same step size ,
where . Consequently,
Constrained Optimization
Consider the constrained optimization problem , where is a convex set. The projected gradient descent iteration is given by
where is the projection of onto .
Stochastic Gradient Descent (SGD)¶
Stochastic Optimization
Stochastic optimzation problem is formulated as
where is a random variable and is the sample-wise loss or cost.
Remark: If is convex for every , then is also convex.
Stochastic gradient oracle: Instead of , we observe a random vector such that .
Goal: Use noisy gradient samples to minimze .
Stochastic Gradient Descent (SGD)
Given a stochastic gradient estimate at iteration , the SGD uodate is
: one-sample estimate of the gradient .
: step size (learning rate) at iteration .
: i.i.d. random sample.
Theorem
Assumptions on the Stochastic Gradient Oracle:
Unbiasedness: for all .
Bounded variance: for all .
Strongly Convex Case: Assume is strongly convec and the stochastic gradient oracle satisfies the above assumptions. Choose step size . Then,
where .
Convergence rate: .
With diminishing step size, SGD converges to the optimal solution exactly.
Example: GD vs SGD¶
Consider the objective function defined as the sum of component functions:
Assumptions:
Smoothness & Convexity: Each is strongly convex and has a Lipschitz continuous gradient.
Oracle Cost: The computation of a single gradient has a cost of .
GD: updates the parameters using the full gradient at each step:
Iteration Complexity: (due to linear convergence in the strongly convex case).
Per-iteration Cost: (must compute all gradients).
Total Cost: .
SGD: picks an index uniformly at random from and approximates the gradient:
The estimator is unbiased because:
Iteration Complexity: (slower sublinear convergence due to gradient noise).
Per-iteration Cost: (only one gradient computed).
Total Cost: .
Decision: To choose between the two, we compare the total costs:
Conclusion: We prefer SGD when the number of samples is very large relative to the desired precision, specifically when .