文章
Convergence Analysis of GD and SGD
·
In this blog, we won't talk about various optimization algorithms, but focus on the two basic algorithms: Gradient Descent and Stochastic Gradient Descent. We w
Convergence of Optimization Algorithms
1 Introduction
We often analyze the convergence rate of optimization algorithms from theoretical perspective. These proofs are often based on some assumptions while the practical scenarios may not satisfy these assumptions. However, these theretical analysis can still provide us some insights of the convergence in application. In this chapter, we won’t talk about various optimization algorithms, but focus on the two basic algorithms: Gradient Descent and Stochastic Gradient Descent. We will analyze the convergence of these two algorithms under different assumptions because many optimization algorithms can be viewed as extensions of these two, and the techniques used in the convergence analysis of these two algorithms can be applied to other optimization algorithms just with some subtle modifications.
References
2 Assumptions and Properties
We can often see some assumptions in the analysis of optimization algorithms in textbooks and research papers. These assumptions are often related to the properties of the objective function or variables. In this section, we will introduce some common assumptions and properties that are often used in the convergence analysis of optimization algorithms.
Assumption 1 (L-Smooth).
A function
Lemma 2 (Descent Lemma).
If
Proposition 3 (Hessian Characterization of L-Smoothness).
A function
Assumption 4 (Strongly Convex).
A function
Proposition 5 (Hessian Characterization of Strong Convexity).
A function
All above are definitions and basic properties of L-smoothness and strongly convexity which can be viewed in many textbooks. Following we will introduce some other properties that are often used in the convergence analysis of optimization algorithms.
Proposition 6 (Convexity and L-Smoothness).
For a function
Proposition 7 (Strongly Convexity and L-Smoothness).
For a function
Proposition 8 (co-coercivity of the gradient).
For a function
Proposition 9 (strengthened co-coercivity).
For a function
Assumption 10 (Bounded Second Moment of Stochastic Gradient).
For a function
for some constant
It is the most common assumption in the convergence analysis of stochastic gradient descent. However, it is not a realistic assumption in many practical scenarios. For example, if
Assumption 11 (Bounded Variance of Stochastic Gradient).
For a function
for some constant
Under the assumption of bounded variance of stochastic gradient, we can derive the following bias-variance decomposition.
Proposition 12 (Bias-Variance Decomposition).
For a function
And furthermore, if the stochastic gradient
3 Get One-step Inequalities
3.1 Smooth and Convex GD
By the update rule of GD:
Expanding the squared distance to the optimal solution
By Proposition 8, we have
Substituting this into the previous inequality, we get
Take
3.2 Smooth and Strongly Convex GD
Function Value Convergence:
By Lemma 2, we have
Substituting the update rule of GD into the above inequality, we get
Applying Proposition 7, we have
Take
Distance Convergence: By Propositon 9, we have
Take
3.3 Convex and Possibly Non-smooth SGD
The update rule of SGD is
where
and that the stochastic gradient is bounded, i.e. Assumption 10 holds. Consider the squared distance to the optimal solution
Taking expectation with respect to
Take
3.4 Strongly Convex and Possibly Non-smooth SGD
We assume that
Taking expectation with respect to
Take
3.5 Smooth and Non-convex SGD
We assume that
Taking expectation with respect to
Take
3.6 Smooth and Strongly Convex SGD
We assume that
Taking expectation with respect to
Applying Proposition 7, we have
Take
4 Solve the Recursion
In last section, we have derived some one-step inequalities for different scenarios. In this section, we will solve these recursions to get the convergence rates of GD and SGD. For the recursion of smooth and convex GD, we have
Summing up the above inequality from
Thus, we have
By convexity of
Thus, we have the convergence rate of smooth and convex GD:
For the recursion of smooth and strongly convex GD, we have
By induction, we have
Thus, we have the convergence rate of smooth and strongly convex GD:
For the distance convergence of smooth and strongly convex GD, we have
By induction, we have
Thus, we have the distance convergence rate of smooth and strongly convex GD:
For the recursion of convex and possibly non-smooth SGD, we have
Summing up the above inequality from
Thus, we have the convergence rate of convex and possibly non-smooth SGD:
For the recursion of strongly convex and possibly non-smooth SGD, we have
By induction, we have
Thus, we have the convergence rate of strongly convex and possibly non-smooth SGD:
For the recursion of smooth and non-convex SGD, we have
Summing up the above inequality from
Thus, we have the convergence rate of smooth and non-convex SGD:
For the recursion of smooth and strongly convex SGD, we have
By induction, we have
Thus, we have the convergence rate of smooth and strongly convex SGD: