Unit 2, lesson 14

Gradient Descent and Optimization

How gradient descent steps against the gradient of an objective function, how the learning rate decides convergence, and how stationary points, local and global minima, convexity and the Hessian describe where it can stop.

  • Video 14
  • Calculus for Optimization

Suppose a model has a single weight ww and training means making the objective L(w)=(w−3)2L(w) = (w - 3)^2 small. The current weight w=0w = 0 gives L(0)=9L(0) = 9. Should the weight go up or down, and by how much? The derivative answers the first question near the current point and a step size answers the second, yet a step in the right direction can still make the objective worse when it is too long. This lesson builds gradient descent from these two pieces, shows how the step size decides whether it converges, and uses convexity and the Hessian to tell what kind of point the iterations can stop at.

Key terms

Objective function

Definition An objective function is a real-valued function JJ on a set Θ⊆Rd\Theta \subseteq \mathbb{R}^d of allowed parameter vectors, chosen so that smaller values are preferred. Optimization looks for a parameter vector θ\boldsymbol{\theta} in Θ\Theta with the smallest value of J(θ)J(\boldsymbol{\theta}), and maximizing a quantity is the same as minimizing its negative. In the examples on this page Θ=Rd\Theta = \mathbb{R}^d, so the parameters are unconstrained. For training data (x1,y1),…,(xn,yn)(x_1, y_1), \dots, (x_n, y_n) with one feature, the linear predictor y^=wx+b\hat{y} = wx + b and the squared error give the objective

J(w,b)=12n∑i=1nri2,ri=wxi+b−yi,\begin{aligned} J(w, b) &= \frac{1}{2n} \sum_{i=1}^{n} r_i^2 , \\[0.4em] r_i &= wx_i + b - y_i , \end{aligned}

where the error rir_i is the prediction minus the target for example ii. This is the average of the loss 12(y^−y)2\tfrac12 (\hat{y} - y)^2 over the training examples, an empirical risk. The factor 12\tfrac12 only simplifies the derivatives and does not change which parameters minimize JJ.

In plain words The objective turns “fit the training data well” into one number for each choice of parameters, and optimization can only improve what that number measures. A small or steadily falling value says that the model fits the training examples better in the chosen sense. Even a global minimum of the objective does not show that the model will predict new data well, because the expected loss on new data, the population risk, is a different quantity, estimated with data that played no part in training. The lesson on loss functions and empirical risk treats this distinction in full.

Example The objective L(w)=(w−3)2L(w) = (w - 3)^2 of the opening has one parameter and its smallest value 00 at w=3w = 3. For a regression example, two constructed training examples have inputs x1=1x_1 = 1 and x2=2x_2 = 2 with targets y1=3y_1 = 3 and y2=5y_2 = 5. With n=2n = 2 the objective is

J(w,b)=14(w+b−3)2+14(2w+b−5)2.\begin{aligned} &J(w, b) = \tfrac14 (w + b - 3)^2 \\[0.4em] &\quad + \tfrac14 (2w + b - 5)^2 . \end{aligned}

At (w,b)=(0,0)(w, b) = (0, 0) both predictions are 00, the errors are −3-3 and −5-5, and J(0,0)=(9+25)/4=8.5J(0, 0) = (9 + 25)/4 = 8.5. At (w,b)=(2,1)(w, b) = (2, 1) both predictions are exact, so J(2,1)=0J(2, 1) = 0, and since JJ is never negative this is the smallest possible value. A line can always pass through two points with different inputs, so this zero says nothing about how well the line predicts at new inputs.

Gradient descent

Definition Let J:Rd→RJ: \mathbb{R}^d \to \mathbb{R} be differentiable. Gradient descent with learning rate α>0\alpha > 0 starts from a chosen point θ0\boldsymbol{\theta}_0 and repeats

θt+1=θt−α∇J(θt)\boldsymbol{\theta}_{t+1} = \boldsymbol{\theta}_t - \alpha \nabla J(\boldsymbol{\theta}_t)

for t=0,1,2,…t = 0, 1, 2, \dots until a set number of steps is done or the gradient norm falls below a chosen tolerance. Every coordinate is updated at once from the gradient at the old point θt\boldsymbol{\theta}_t. The negative gradient is a descent direction. If g=∇J(θ)≠0\mathbf{g} = \nabla J(\boldsymbol{\theta}) \ne \mathbf{0}, the function φ(s)=J(θ−sg)\varphi(s) = J(\boldsymbol{\theta} - s\mathbf{g}) has derivative φ′(0)=−∥g∥22<0\varphi'(0) = -\lVert \mathbf{g} \rVert_2^2 < 0, so J(θ−sg)<J(θ)J(\boldsymbol{\theta} - s\mathbf{g}) < J(\boldsymbol{\theta}) for every sufficiently small s>0s > 0. Among unit vectors u\mathbf{u}, the directional derivative ∇J(θ)⊤u\nabla J(\boldsymbol{\theta})^{\top}\mathbf{u} is then smallest for u=−g/∥g∥2\mathbf{u} = -\mathbf{g} / \lVert \mathbf{g} \rVert_2, so the negative gradient is the direction of steepest descent. At a stationary point, where the gradient is 0\mathbf{0}, the update leaves the parameters unchanged.

In plain words At the current parameters, find the direction in which the objective rises fastest, take a step the opposite way, and repeat from the new point. The gradient is recomputed after every step because the slope changes as the parameters move. The guarantee is local. A short enough step goes downhill, but the direction alone does not say how long a step is safe.

Example For L(w)=(w−3)2L(w) = (w - 3)^2 the derivative is L′(w)=2(w−3)L'(w) = 2(w - 3), so L′(0)=−6L'(0) = -6. With α=0.1\alpha = 0.1 the first update is

w1=0−0.1⋅(−6)=0.6,w_1 = 0 - 0.1 \cdot (-6) = 0.6 ,

and the objective falls from 99 to 5.765.76. The derivative at 0.60.6 is −4.8-4.8, so w2=0.6+0.48=1.08w_2 = 0.6 + 0.48 = 1.08 and the objective is 3.68643.6864. The second step is shorter because the slope has shrunk. For the regression objective J(w,b)J(w, b) of the previous card, the chain rule gives

∂J∂w=1n∑i=1nrixi,∂J∂b=1n∑i=1nri,\begin{aligned} \frac{\partial J}{\partial w} &= \frac{1}{n} \sum_{i=1}^{n} r_i x_i , \\[0.4em] \frac{\partial J}{\partial b} &= \frac{1}{n} \sum_{i=1}^{n} r_i , \end{aligned}

with the 22 from the square canceling the 12\tfrac12. At (0,0)(0, 0) the errors −3-3 and −5-5 give ∂J/∂w=(−3−10)/2=−6.5\partial J / \partial w = (-3 - 10)/2 = -6.5 and ∂J/∂b=(−3−5)/2=−4\partial J / \partial b = (-3 - 5)/2 = -4. One step with α=0.1\alpha = 0.1 uses both of these old partial derivatives and gives (w,b)=(0.65,0.4)(w, b) = (0.65, 0.4). The new predictions 1.051.05 and 1.71.7 have errors −1.95-1.95 and −3.3-3.3, so the objective drops from 8.58.5 to (3.8025+10.89)/4=3.673125(3.8025 + 10.89)/4 = 3.673125. More steps are needed to approach the exact fit at (2,1)(2, 1).

Learning rate

Definition The learning rate, or step size, is the number α>0\alpha > 0 in the gradient descent update. The step has length α∥∇J(θt)∥2\alpha \lVert \nabla J(\boldsymbol{\theta}_t) \rVert_2, and whether the iterates settle depends on α\alpha together with how fast the gradient can change. Suppose J:Rd→RJ: \mathbb{R}^d \to \mathbb{R} is differentiable and β\beta-smooth for some β>0\beta > 0, meaning that for all a\mathbf{a} and b\mathbf{b}

∥∇J(a)−∇J(b)∥2≤β∥a−b∥2.\begin{aligned} &\lVert \nabla J(\mathbf{a}) - \nabla J(\mathbf{b}) \rVert_2 \\[0.4em] &\quad \le \beta \lVert \mathbf{a} - \mathbf{b} \rVert_2 . \end{aligned}

Then for every θ\boldsymbol{\theta}, with g=∇J(θ)\mathbf{g} = \nabla J(\boldsymbol{\theta}),

J(θ−αg)≤J(θ)−α(1−αβ2)∥g∥22,\begin{aligned} &J(\boldsymbol{\theta} - \alpha\mathbf{g}) \le J(\boldsymbol{\theta}) \\[0.4em] &\quad - \alpha\bigl(1 - \tfrac{\alpha\beta}{2}\bigr) \lVert \mathbf{g} \rVert_2^2 , \end{aligned}

so every learning rate in (0,2/β)(0, 2/\beta) lowers JJ at each step where g≠0\mathbf{g} \ne \mathbf{0}. If JJ is also convex, in the sense of the card below, and has a global minimum θ∗\boldsymbol{\theta}^*, then gradient descent with 0<α≤1/β0 < \alpha \le 1/\beta satisfies

J(θt)−J(θ∗)≤∥θ0−θ∗∥222αt\begin{aligned} &J(\boldsymbol{\theta}_t) - J(\boldsymbol{\theta}^*) \\[0.4em] &\quad \le \frac{\lVert \boldsymbol{\theta}_0 - \boldsymbol{\theta}^* \rVert_2^2}{2\alpha t} \end{aligned}

for every t≥1t \ge 1, so the objective values converge to the minimum value. These conditions are sufficient, not necessary, and the bound concerns objective values. It does not say which minimum the iterates approach when there are several.

In plain words The gradient says which way is downhill right here, and the learning rate says how far to trust that local information. A rate that is too small makes progress slow. A rate that is too large can carry a step so far past the minimum that the objective rises, and for a bowl such as (w−3)2(w - 3)^2 the iterates then move farther away with every step. Where the gradient changes quickly, the safe steps are short.

Example For L(w)=(w−c)2L(w) = (w - c)^2 with any constant cc, write et=wt−ce_t = w_t - c for the error after tt steps. Subtracting cc from both sides of the update wt+1=wt−2α(wt−c)w_{t+1} = w_t - 2\alpha(w_t - c) gives

et+1=(1−2α) et.e_{t+1} = (1 - 2\alpha)\, e_t .

Each step multiplies the error by the same factor, so from any start other than cc the iterates converge exactly when ∣1−2α∣<1\lvert 1 - 2\alpha \rvert < 1, that is, for 0<α<10 < \alpha < 1. For α<12\alpha < \tfrac12 they approach cc from one side, at α=12\alpha = \tfrac12 they reach it in one step, and for 12<α<1\tfrac12 < \alpha < 1 they jump across it every time while the error still shrinks. With c=3c = 3 and w0=0w_0 = 0, the rate α=1\alpha = 1 sends the iterates to 66, back to 00 and so on, with the objective stuck at 99. The rate α=1.1\alpha = 1.1 gives 6.66.6 and then −1.32-1.32, and the objective climbs from 99 to 12.9612.96 and then to 18.662418.6624, although each step pointed downhill at its starting point. Here L′L' changes by exactly 22 per unit of ww, so LL is 22-smooth. The general results then promise a decrease for α<1\alpha < 1 and the convergence bound for α≤12\alpha \le \tfrac12, and the convergence for 12<α<1\tfrac12 < \alpha < 1 shows that the condition α≤1/β\alpha \le 1/\beta is not necessary.

Local and global minima

Definition Let JJ be a real-valued function on a set Θ⊆Rd\Theta \subseteq \mathbb{R}^d. A point θ∗\boldsymbol{\theta}^* in Θ\Theta is a global minimum of JJ if J(θ∗)≤J(θ)J(\boldsymbol{\theta}^*) \le J(\boldsymbol{\theta}) for every θ\boldsymbol{\theta} in Θ\Theta. It is a local minimum if there is a radius r>0r > 0 such that J(θ∗)≤J(θ)J(\boldsymbol{\theta}^*) \le J(\boldsymbol{\theta}) for every θ\boldsymbol{\theta} in Θ\Theta with ∥θ−θ∗∥2<r\lVert \boldsymbol{\theta} - \boldsymbol{\theta}^* \rVert_2 < r. Some books call such a point a minimizer and keep the word minimum for the value J(θ∗)J(\boldsymbol{\theta}^*). Every global minimum is a local minimum. A stationary point is a point where JJ is differentiable and its gradient is 0\mathbf{0}. If a local minimum lies in the interior of Θ\Theta and JJ is differentiable there, it is a stationary point. The converse fails, because a stationary point can also be a local maximum or a saddle point, a stationary point that is neither. A function may have several global minima or none at all.

In plain words A local minimum is the lowest point of some neighborhood around it, and a global minimum is the lowest point of everything allowed. A zero gradient only says that the graph is flat at that spot. The spot may be a valley floor, a hilltop or a pass between two hills. If an iterate of gradient descent lands exactly on a stationary point, every later iterate stays there, so the fact that the iterates have stopped moving does not say which kind of point they found.

Example For L(w)=(w−3)2L(w) = (w - 3)^2 the only stationary point is w=3w = 3, and it is the global minimum because a square is never negative and equals 00 there. The function −w2-w^2 has derivative 00 at w=0w = 0, which is its global maximum. The function w3w^3 also has derivative 00 at w=0w = 0, but it is negative to the left of 00 and positive to the right, so 00 is neither a minimum nor a maximum. The function f(w)=w3−3wf(w) = w^3 - 3w has the stationary points −1-1 and 11. Since

f(w)−f(1)=(w−1)2(w+2)\begin{aligned} &f(w) - f(1) \\[0.4em] &\quad = (w - 1)^2 (w + 2) \end{aligned}

is nonnegative for w≥−2w \ge -2, the point w=1w = 1 is a local minimum with f(1)=−2f(1) = -2. It is not global, because f(−3)=−18f(-3) = -18, and ff has no global minimum at all, since f(w)→−∞f(w) \to -\infty as w→−∞w \to -\infty.

Convex function

Definition A set C⊆RdC \subseteq \mathbb{R}^d is convex if it contains the whole line segment between any two of its points. A function J:C→RJ: C \to \mathbb{R} on a convex set CC is convex if

J(λa+(1−λ)b)≤λJ(a)+(1−λ)J(b)\begin{aligned} &J\bigl(\lambda\mathbf{a} + (1 - \lambda)\mathbf{b}\bigr) \\[0.4em] &\quad \le \lambda J(\mathbf{a}) + (1 - \lambda) J(\mathbf{b}) \end{aligned}

for all a\mathbf{a} and b\mathbf{b} in CC and every λ\lambda in [0,1][0, 1]. For a convex function every local minimum is a global minimum. If JJ is convex and differentiable on all of Rd\mathbb{R}^d, a point is a global minimum exactly when the gradient there is 0\mathbf{0}. If JJ is twice continuously differentiable on an open convex set, it is convex exactly when its Hessian is positive semidefinite at every point of that set. Convexity alone does not promise that a minimum exists, that it is unique, or that gradient descent with a particular fixed learning rate converges.

In plain words Every chord between two points of the graph lies on or above the graph, so the graph has no false bottoms. If some point a\mathbf{a} had a lower value than a local minimum θ∗\boldsymbol{\theta}^*, the inequality would put lower values on the segment toward a\mathbf{a} arbitrarily close to θ∗\boldsymbol{\theta}^*, which a local minimum rules out. For a convex objective a stationary point settles the optimization question. It settles nothing about prediction, since a global minimum of the training objective can still describe new data poorly. The squared-error objective of a linear model is convex in its weights and intercept, while the training objectives of neural networks with hidden layers are in general not convex.

Example For L(w)=(w−3)2L(w) = (w - 3)^2 and any aa, bb and λ\lambda in [0,1][0, 1], a short computation gives

λL(a)+(1−λ)L(b)−L(λa+(1−λ)b)=λ(1−λ)(a−b)2,\begin{aligned} &\lambda L(a) + (1 - \lambda) L(b) \\[0.4em] &\quad - L\bigl(\lambda a + (1 - \lambda) b\bigr) \\[0.4em] &= \lambda (1 - \lambda)(a - b)^2 , \end{aligned}

which is never negative, so the bowl is convex. The function f(w)=w3−3wf(w) = w^3 - 3w of the previous card is not convex. At the midpoint of −2-2 and 00 its value f(−1)=2f(-1) = 2 lies above the chord value 12(f(−2)+f(0))=−1\tfrac12 \bigl(f(-2) + f(0)\bigr) = -1. Only a function that is not convex can have a local minimum that is not global, as this one does. The function J(w1,w2)=(w1+w2−2)2J(w_1, w_2) = (w_1 + w_2 - 2)^2 is convex, and every point on the line w1+w2=2w_1 + w_2 = 2 is a global minimum. Flat valleys like this one appear when a model contains the same feature twice, because then only the sum of the two weights affects the predictions. The function ewe^w is convex and has no minimum at all.

Hessian matrix

Definition Let J:Rd→RJ: \mathbb{R}^d \to \mathbb{R} have second partial derivatives at θ\boldsymbol{\theta}. The Hessian matrix H(θ)H(\boldsymbol{\theta}) is the d×dd \times d matrix with entries

Hij(θ)=∂2J∂θi ∂θj(θ).H_{ij}(\boldsymbol{\theta}) = \frac{\partial^2 J}{\partial \theta_i \, \partial \theta_j}(\boldsymbol{\theta}) .

If the second partial derivatives are continuous near θ\boldsymbol{\theta}, the matrix is symmetric. In one dimension it is the second derivative J′′J''. For a twice continuously differentiable JJ,

J(θ+v)≈J(θ)+∇J(θ)⊤v+12v⊤H(θ)v\begin{aligned} J(\boldsymbol{\theta} + \mathbf{v}) &\approx J(\boldsymbol{\theta}) \\[0.4em] &\quad + \nabla J(\boldsymbol{\theta})^{\top} \mathbf{v} \\[0.4em] &\quad + \tfrac12 \mathbf{v}^{\top} H(\boldsymbol{\theta}) \mathbf{v} \end{aligned}

with an error that is small compared with ∥v∥22\lVert \mathbf{v} \rVert_2^2 as v→0\mathbf{v} \to \mathbf{0}. A symmetric matrix HH is positive definite if v⊤Hv>0\mathbf{v}^{\top} H \mathbf{v} > 0 for every v≠0\mathbf{v} \ne \mathbf{0}, and positive semidefinite if v⊤Hv≥0\mathbf{v}^{\top} H \mathbf{v} \ge 0 for every v\mathbf{v}. At a stationary point θ∗\boldsymbol{\theta}^* of a twice continuously differentiable JJ, a positive definite Hessian makes θ∗\boldsymbol{\theta}^* a strict local minimum, a negative definite one makes it a strict local maximum, and a Hessian with both a positive and a negative eigenvalue makes it a saddle point. If the Hessian at θ∗\boldsymbol{\theta}^* is semidefinite but singular, this test decides nothing.

In plain words The gradient gives the slope, and the Hessian gives how the slope changes, the curvature, in every direction. A positive value of v⊤Hv\mathbf{v}^{\top} H \mathbf{v} means that the graph bends upward along v\mathbf{v}. At a flat spot, upward bending in every direction makes the bottom of a bowl, and bending up in some directions and down in others makes a pass. Where the curvature is large the slope changes quickly, and that is where long steps overshoot.

Example For the regression objective J(w,b)J(w, b), differentiating the partial derivatives once more gives the constant Hessian

H=1n∑i=1n[xi2xixi1],H = \frac{1}{n} \sum_{i=1}^{n} \begin{bmatrix} x_i^2 & x_i \\ x_i & 1 \end{bmatrix} ,

and for the inputs 11 and 22 it is

H=[2.51.51.51].H = \begin{bmatrix} 2.5 & 1.5 \\ 1.5 & 1 \end{bmatrix} .

For any direction v=(vw,vb)\mathbf{v} = (v_w, v_b),

v⊤Hv=1n∑i=1n(xivw+vb)2≥0,\begin{aligned} \mathbf{v}^{\top} H \mathbf{v} &= \frac{1}{n} \sum_{i=1}^{n} (x_i v_w + v_b)^2 \\[0.4em] &\ge 0 , \end{aligned}

so this squared-error objective is convex. For a linear model with several features the same computation gives the average squared change in the predictions per unit step along v\mathbf{v}, so its squared-error objective is convex too. With the inputs 11 and 22 the sum is 00 only when vw+vb=0v_w + v_b = 0 and 2vw+vb=02v_w + v_b = 0, which forces v=0\mathbf{v} = \mathbf{0}. The Hessian is positive definite, and (2,1)(2, 1) is the unique global minimum. If all inputs were equal, the sum would vanish for some nonzero v\mathbf{v} and a flat valley would appear. Since the gradient changes by H(a−b)H(\mathbf{a} - \mathbf{b}) between two points, JJ is β\beta-smooth with β\beta equal to the largest eigenvalue of HH. The eigenvalues (7±35)/4(7 \pm 3\sqrt{5})/4 are about 3.433.43 and 0.0730.073, so the rate α=0.1\alpha = 0.1 is below 1/β≈0.291/\beta \approx 0.29. On this quadratic, fixed steps converge from every start when 0<α<2/β≈0.580 < \alpha < 2/\beta \approx 0.58 and diverge from almost every start for larger rates. For a saddle, take f(u,v)=u2−v2f(u, v) = u^2 - v^2. Its gradient is 0\mathbf{0} at the origin and its Hessian there has diagonal entries 22 and −2-2, so the origin is a saddle point. The functions w4w^4 and −w4-w^4 both have second derivative 00 at 00, yet 00 is a minimum of the first and a maximum of the second.

Check yourself

  1. Gradient descent minimizes L(w)=(w−4)2L(w) = (w - 4)^2 from w0=1w_0 = 1 with learning rate α=0.2\alpha = 0.2. Compute the derivative at the start, the next iterate, and the objective before and after the step.
Show the answer

The derivative is L′(w)=2(w−4)L'(w) = 2(w - 4), so L′(1)=2⋅(−3)=−6L'(1) = 2 \cdot (-3) = -6. The update gives

w1=1−0.2⋅(−6)=2.2.w_1 = 1 - 0.2 \cdot (-6) = 2.2 .

The objective falls from (1−4)2=9(1 - 4)^2 = 9 to (2.2−4)2=3.24(2.2 - 4)^2 = 3.24. The step moved toward the minimum at 44, and the remaining error −1.8-1.8 is 0.60.6 times the starting error −3-3.

  1. Repeat the first step with α=1.2\alpha = 1.2. A classmate argues that the step must lower the objective because it follows the negative gradient. Find the new iterate and the objective, explain what went wrong, and give the learning rates for which gradient descent on this function converges from w0=1w_0 = 1.
Show the answer

The derivative at the start is still −6-6, so the new iterate is w1=1−1.2⋅(−6)=8.2w_1 = 1 - 1.2 \cdot (-6) = 8.2. The objective becomes (8.2−4)2=17.64(8.2 - 4)^2 = 17.64, larger than 99. The negative gradient only promises a decrease for steps that are short enough. This step crosses the minimum and lands 4.24.2 away from it, farther than the starting distance 33.

Write et=wt−4e_t = w_t - 4 for the error. Subtracting 44 from both sides of the update gives

et+1=(1−2α) et.e_{t+1} = (1 - 2\alpha)\, e_t .

At α=1.2\alpha = 1.2 the factor is −1.4-1.4, so the error goes from −3-3 to 4.24.2 to −5.88-5.88, alternating in sign and growing, and the objective climbs from 99 to 17.6417.64 to 34.574434.5744. The starting error is not zero, so the iterates converge exactly when ∣1−2α∣<1\lvert 1 - 2\alpha \rvert < 1, that is, for 0<α<10 < \alpha < 1. The rate 0.20.2 of the first question gives the factor 0.60.6 and converges.

  1. Find the stationary point and the Hessian of J(u,v)=u2+4uv+v2J(u, v) = u^2 + 4uv + v^2. Both diagonal entries of the Hessian are positive. Is the stationary point a minimum, and is JJ convex?
Show the answer

The gradient is (2u+4v, 4u+2v)(2u + 4v, \, 4u + 2v). The first entry is zero when u=−2vu = -2v, and then the second is −8v+2v=−6v-8v + 2v = -6v, which is zero only for v=0v = 0. So the only stationary point is the origin. The Hessian is the same at every point,

H=[2442],H = \begin{bmatrix} 2 & 4 \\ 4 & 2 \end{bmatrix} ,

with eigenvalue 66 for the direction (1,1)(1, 1) and eigenvalue −2-2 for the direction (1,−1)(1, -1). Positive diagonal entries are not enough, because the Hessian has a negative eigenvalue. Along (1,−1)(1, -1) the function is J(t,−t)=t2−4t2+t2=−2t2J(t, -t) = t^2 - 4t^2 + t^2 = -2t^2, which is negative for every t≠0t \ne 0, while along (1,1)(1, 1) it is J(t,t)=6t2J(t, t) = 6t^2. So the origin is a saddle point, not a minimum.

The function is not convex, since its Hessian is not positive semidefinite, and it has no global minimum, since −2t2-2t^2 decreases without bound. Gradient descent started exactly at the origin never moves. Started slightly off it along (1,−1)(1, -1), each step multiplies the distance from the origin by 1+2α1 + 2\alpha, so the iterates move away.

How this lesson connects