0% found this document useful (0 votes)
31 views3 pages

Machine Learning Optimization Notes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Machine Learning Optimization Notes

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Optimization for Machine Learning

Lecture Notes CS-439, Spring 2025

Bernd Gärtner, ETH


Martin Jaggi, EPFL

February 17, 2025


Contents

1 Theory of Convex Functions 2–38

2 Gradient Descent 38–61

3 Projected and Proximal Gradient Descent 61–77

4 Subgradient Descent 77–88

5 Stochastic Gradient Descent 88–96

6 Nonconvex functions 96–115

7 Newton’s Method 115–127

8 Quasi-Newton Methods 127–145

9 Coordinate Descent 145–160

10 The Frank-Wolfe Algorithm 160–180

1
Chapter 1

Theory of Convex Functions

Contents
1.1 Mathematical Background . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.2 The Cauchy-Schwarz inequality . . . . . . . . . . . . 4
1.1.3 The spectral norm . . . . . . . . . . . . . . . . . . . . 6
1.1.4 The mean value theorem . . . . . . . . . . . . . . . . . 7
1.1.5 The fundamental theorem of calculus . . . . . . . . . 7
1.1.6 Differentiability . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Convex sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.1 The mean value inequality . . . . . . . . . . . . . . . 10
1.3 Convex functions . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1 First-order characterization of convexity . . . . . . . 16
1.3.2 Second-order characterization of convexity . . . . . . 19
1.3.3 Operations that preserve convexity . . . . . . . . . . 21
1.4 Minimizing convex functions . . . . . . . . . . . . . . . . . . 21
1.4.1 Strictly convex functions . . . . . . . . . . . . . . . . . 23
1.4.2 Example: Least squares . . . . . . . . . . . . . . . . . 24
1.4.3 Constrained Minimization . . . . . . . . . . . . . . . . 25
1.5 Existence of a minimizer . . . . . . . . . . . . . . . . . . . . . 26
1.5.1 Sublevel sets and the Weierstrass Theorem . . . . . . 27
1.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.6.1 Handwritten digit recognition . . . . . . . . . . . . . 28
1.6.2 Master’s Admission . . . . . . . . . . . . . . . . . . . 29

Common questions

Powered by AI

Gradient Descent is advantageous because it is simple to implement and requires only first-order derivative information, making it computationally inexpensive per iteration. However, it may converge slowly, especially around shallow regions of the function. Newton's method generally converges faster due to its use of second-order derivative information (Hessian matrix), which provides insight into the curvature of the function, but this comes at a higher computational cost because calculating and inverting the Hessian is expensive for large-scale problems .

Optimizing nonconvex functions is inherently more challenging because they can exhibit multiple local minima and saddle points, making it difficult to ensure convergence to a global minimum. The landscape of nonconvex functions lacks the consistent properties of convexity, such as any found minimum being global, which complicates the design of reliable algorithms and often necessitates complex heuristics or stochastic methods such as Simulated Annealing or Genetic Algorithms to navigate the solution space effectively and avoid convergence to suboptimal points .

The mean value theorem in the context of convex functions helps in establishing an average rate of change of the function over an interval. Specifically, for a differentiable convex function, it implies that the function's gradient at any point gives a linear lower bound on the function’s values in nearby regions. This application allows better understanding and analysis of function behavior, aiding in proofs of convergence and in optimizing step sizes for algorithms such as Gradient Descent .

The Weierstrass Theorem asserts that a continuous function defined on a compact set attains a minimum and a maximum, confirming the existence of a minimizer. In convex function optimization, the theorem provides the foundational guarantee that for convex functions with closed and bounded sublevel sets, we can be assured of the existence of a global minimizer. This is critical for justifying the convergence of optimization algorithms in practice .

The Cauchy-Schwarz inequality is a tool used to measure the angle-related relationship between two vectors and guarantees that a specific geometric condition holds, which is pivotal in ensuring certain properties of convexity in optimization. It supports optimization by providing bounds that are crucial in the construction and analysis of proofs involving convex sets and functions, thereby allowing the gradient steps or movement directions during optimization to remain within bounds, supporting convergence .

The first-order characterization of convexity states that a function f is convex if and only if its domain is a convex set and for all points x and y in its domain, the inequality f(y) ≥ f(x) + ∇f(x) · (y - x) holds. This is significant because it provides a way to utilize gradient information to ensure a function is convex, which simplifies analyses and algorithms, allowing for better approximation and decision-making in optimization tasks .

Strictly convex functions are those where the line segment connecting any two points on the function's graph lies entirely above the graph, except at the endpoints. This property ensures that any local minimum is also a global minimum and guarantees its uniqueness, as the strict increase or decrease of the function away from the minimum prohibits any flat regions. Consequently, optimization problems involving strictly convex functions are easier to solve because we are assured that any found minimum is unique, eliminating ambiguity in solutions .

Projected Gradient Descent handles constraints by projecting each update onto the feasible set, ensuring that iterates remain within the allowable region throughout the optimization process. This resembles solving a constrained optimization problem by enforcing feasibility at every step. Proximal Gradient Descent, on the other hand, incorporates a proximal term that regularizes the update, effectively smoothing or reducing oscillations, and is particularly useful for non-smooth or composite functions. These methods are crucial for problems with complex constraints where traditional gradient-based methods would struggle or require cumbersome penalty terms .

Operations that preserve convexity, such as non-negative weighted sums, affine transformations, and pointwise maxima, allow for the construction and manipulation of convex functions without losing their desirable properties. This enhances the flexibility in designing optimization algorithms as developers can combine, scale, and transform convex models to fit specific problem needs while ensuring they remain within the realm where efficient optimization techniques can be applied. This leads to more robust and adaptable algorithmic solutions .

The Frank-Wolfe algorithm, also known as the Conditional Gradient method, is computationally efficient in terms of iterating with a simple linear minimization step, avoiding the computation of gradients for constraints directly. It is advantageous in large-scale optimization problems where the feasible region is described by a polytope or other convex set. However, its convergence rate is slower compared to first-order methods like Gradient Descent and second-order methods like Newton's because it relies on solving a linear subproblem at each step and may require more iterations to achieve the same accuracy. It is best suited for certain scenarios where other methods' setup or iteration costs are prohibitive .

You might also like