# Theory of Optimization: Gradient Descent

Published:

In this post, we will review the most basic and the most intuitive optimization method – the gradient decent method – in optimization.

The gradient descent algorithm works as follow: The algorithm requires an initial point $x^{(0)}\in\mathbb R^n$ and step size $h > 0$. Then the algorithm repeats to execute:

until $||\nabla f(x^{(t)})|| \le \epsilon$. In the following of this section, we will assume that the gradient of $f$ is L-lipschitz, i.e.

we call $f$ is L-lipschitz gradient or L-smooth.

### Analysis for General Smooth Functions

In order to show the convergence of gradient descent for the general functions, we need the following lemma,

Suppose $f$ is L-lipschitz gradient, then

Proof: From the basic calculus and the assumption that $f$ is L-lipschitz gradient, we have

The previous lemma shows and upper and lower bound of a point if the gradient of the function is lipschitz. From the previous lemma, we can then show the convergence of gradient descent.

Let $f$ be a function with L-Lipschitz gradient and $x^*$ be any minimizer of $f$. The gradient descent with step size $h = \frac{1}{L}$ outputs a point $x$ such that $||\nabla f(x)||\le \epsilon$ in $\frac{2L}{\epsilon^2}(f(x^{(0)}) - f(x^*))$ iterations.

Proof: From the previous lemma, we have the following equation

Then we have $||\nabla f(x^{(t)})||^2 \le 2L \cdot f(x^{(t)}) - f(x^{(t+1)}).$

Sum up the equations for $t=1,2,\dots$, we can get

From this equation, we can see that the gradient descent outputs a point $x$ such that $||\nabla f(x)||\le \epsilon$ in $\frac{2L}{\epsilon^2}(f(x^{(0)}) - f(x^*))$ iterations.

### Analysis for Convex Functions

In this section, we assume that the function $f$, which we want to optimize, is convex with L-lipschitz gradient. As a result of the convexity, we can show that the difference between $f(x^*)$ and $f(x^{(t)})$ is $O(\frac{1}{t})$. Before we state the theorem, we prove an auxilary lemma.

For any convex function $f\in\mathcal C^1(\mathbb R^n)$, we have

Proof: From the first order condition, if $f$ is convex, we have

Arranging the terms and using the basic property of norms, we have

With the help of the previous lemma, we can show the convergence bound for convex functions now.

Let $f\in\mathcal C^2(\mathbb R^n)$ be convex with L-Lipschitz gradient and $x^*$ be any minimizer of $f$. With step size $h = \frac{1}{L}$, the sequence $x^{(k)}$ in Gradient Descent satis es

where $D = \max_{f(x) \le f(x^{(0)})}||x-x^*||_2.$

Proof: Let $\epsilon_k = f(x^{(k)}) - f(x^*)$. Since $f$ is L-lipschitz gradient, we have

Then from the previous lemma, we have

Therefore, we have

Moreover, we can also bound $\epsilon_0$ by the following inequality,

Then we have

Then

which completes the proof.

### Strongly Convex Functions

In the previous analysis for general smooth functions and convex functions, we show that the gradient descent algorithm needs $O(\frac{1}{\epsilon^2})$ and $O(\frac{1}{\epsilon})$ iterations to converge to an $\epsilon$-approximation(Note: Here, $\epsilon$-approximation does not mean the formal definition of $\epsilon$-approximation in approximation algorithms. In the sense of convergence of general functions, it means the gradient is small, and in the sense of convergence of convex functions, it means the error to the optimal is small). Now we introduce the strongly convex functions, and analysis the convergence of gradient descent algorithm for strongly convex functions. In particular, we will show that it will use $poly(\log\frac{1}{\epsilon})$ iterations to converge to an $\epsilon$-approximation.

Strongly convex: We call a function $f \in \mathcal C^1(\mathbb R^n)$ is $\mu$-strongly convex if for any $x, y \in \mathbb R^n$,

The following theorem gives an equivalent definition for strongly convex funtions if the function is twice differentiable.

Strongly convex: Let $f \in \mathcal C^2(\mathbb R^n)$. Then $f$ is $\mu$-strongly convex if and only if

We will not prove this theorem. This theorem can be shown by the Taylor’s expansion in multi-variable case.

With the definition of strongly convex functions, we can now prove the following theorem.

Let $f\in\mathcal C^2(\mathbb R^n)$ be $\mu$-strongly convex with L-Lipschitz gradient and $x^*$ be any minimizer of $f$. With step size $h = \frac{1}{L}$, the sequence $x^{(k)}$ in GradientDescent satis es

Proof: From the previous analysis, since $f$ is L-lipschitz gradient, we have

where $\epsilon_k = f(x^{(k)}) - f(x^*)$.

Then since $f$ is $\mu$-strongly convex, we have

Rearranging the terms, we have

Putting the above inequality into the first inequality in the proof, we have

Tags: