Convex Optimization Notes
Convex vs. Non-Convex Optimization
- Importance of Separation:
- Convex optimization significantly reduces task complexity.
- Non-convex optimization may not guarantee finding the global minimum/maximum and often relies on heuristics.
Proving Convexity of Objective Function:
Objective function: The function being optimized (e.g., cost function, loss function).
- Example: Presidential candidates allocating resources (money , states , advertisement methods) to maximize votes.
Minimization vs. Maximization:
- Principles apply to both minimization and maximization problems.
- Convex functions guarantee that any local minimum found is also the global minimum.
Methods to Check Convexity:
1. Instance Inequality (Secant Inequality):
Definition: The secant line between any two points on the function lies above the graph of the function.
Mathematical Representation:
- For between 0 and 1:
f(t\cdot x1 + (1-t) \cdot x2) <= t \cdot f(x1) + (1-t) \cdot f(x2)
- For between 0 and 1:
Explanation:
- and are two points on the x-axis.
- and are the corresponding function values.
- The line connecting and is the secant line.
2. Twice Continuous Differentiability:
Condition: If the second derivative of a function is greater than or equal to zero for all , the function is convex.
Mathematical Representation:
- f''(x) >= 0 for all
Example:
- is convex because f''(x) = 2 > 0.
3. Epigraph and Convex Sets:
Epigraph: The area above the function's graph.
Convex Set: A set where the line segment between any two points in the set is entirely contained within the set.
* Example: Imagine a rubber band stretched over a shape/layer. A convex shape is formed if the rubber band lies entirely within the shape.
* Non-example: If a line segment goes outside of the shape, then the shape isn't a convex set.Convex Function: If the epigraph of a function is a convex set, then the function is a convex function.
4. Hessian Matrix:
Condition: A function is convex if and only if all eigenvalues of its Hessian matrix are non-negative real numbers for all .
Hessian Matrix:
- Matrix of second partial derivatives of a function.
H(f(x)) = \begin{bmatrix}
\frac{\partial^2 f}{\partial x1^2} & \frac{\partial^2 f}{\partial x1 \partial x2} & \cdots & \frac{\partial^2 f}{\partial x1 \partial xn} \ \frac{\partial^2 f}{\partial x2 \partial x1} & \frac{\partial^2 f}{\partial x2^2} & \cdots & \frac{\partial^2 f}{\partial x2 \partial xn} \
\vdots & \vdots & \ddots & \vdots \
\frac{\partial^2 f}{\partial xn \partial x1} & \frac{\partial^2 f}{\partial xn \partial x2} & \cdots & \frac{\partial^2 f}{\partial x_n^2}
\end{bmatrix}
Finding Minimum of a Convex Function
Process:
- Calculate the gradient (first derivative) of the function.
- Find the root(s) of the gradient by setting it to zero.
- Solve for to find the point(s) where the minimum occurs.
Example:
Given: Some convex function (e.g. a parabola)
implies thatSubstituting into the original function gives the value of :
Non-Convex Optimization
Nature-inspired methods: Used when convexity cannot be proven.
- Examples: Bracketing and Downhill Simplex.
Bracketing Method
Bracketing a root
Objective: Find a root for function
Process:
Find two points and with opposite signs:
and g(x2) > 0Iteratively narrow the bracket:
- Find a new point such that g(x3) < 0
- Replace with
- Continue until convergence.
Convergence Conditions:
Maximum number of iterations reached. OR
Difference between values in consecutive iterations is sufficiently small.
Bisection Search:
- Select the midpoint between and as new point to test.
Bracketing a minimum/maximum
Objective: Find a minimum or maximum for a non-convex function.
Process: Requires 3 points, two edges and one point between then. The value of the point between them must be lower than the edges to have a bracket.
Golden Section Search
- Mathematical expression:
- Use: Provides a more efficient way of selecting points.
Bisection Search vs. Golden Section Search (homework):
- Compare performance of bisection search (50% ratio) vs. golden section search.
Golden Ratio
- The golden ratio is approximately 1.618 to 1. It is nature's perfect proportion for bringing parts together in a greater whole. It is present in the golden rectangle, the golden spiral and star, in the ratio between the numbers in the Fibonacci sequence.