Deep Learning Book (Goodfellow, Bengio & Courville)

Learn / Deep Learning Book

04 - Numerical Computation

Advanced mastery of Chapter 4, Numerical Computation, covering every named section across book pages 80-97.

Learning path

0%

0 of 4 sections marked complete · about 42 minutes

Learning objectives

What you will be able to explain

  • Stabilize a softmax
  • Floating-point failure modes
  • Poor conditioning
  • Derivative objects
  • Directional derivative
  • Critical points and curvature

Section 01

Stabilize a softmax to Poor conditioning

01

Stabilize a softmax

Adding or subtracting a shared constant cancels between numerator and denominator. Subtracting the maximum makes the largest exponent zero and all others nonpositive.

Guided checkpoint

To compute softmax(x)i=exp(xi)/jexp(xj)softmax(x)_i=\exp(x_i)/\sum_j\exp(x_j) without overflow, which transformation preserves the result?

Source: Chapter 4, section 4.1, pp. 80-82

02

Floating-point failure modes

Normalization does not reliably repair infinities, for example infinity divided by infinity. Log-domain computation and shared-offset tricks are standard remedies.

Guided checkpoint

Mark each statement as true or false.

Source: Chapter 4, section 4.1, pp. 80-82

03

Poor conditioning

Conditioning describes sensitivity of the mathematical problem itself. For a Hessian, widely differing eigenvalue magnitudes also create difficult optimization geometry.

Guided checkpoint

What does a large condition number imply for numerical computation?

Source: Chapter 4, section 4.2, p. 82

Section 02

Derivative objects to Critical points and curvature

01

Derivative objects

The gradient gives the direction of steepest local increase under the Euclidean norm, while the Hessian characterizes local curvature.

Guided checkpoint

Match each object to its role.

Source: Chapter 4, section 4.3, pp. 82-92

02

Directional derivative

The maximum is attained in the gradient direction and equals f2=5||\nabla f||_2=5.

Guided checkpoint

At a point, f=[3,4]T\nabla f=[3,4]^T. Compute the maximum directional derivative over all unit directions.

Source: Chapter 4, section 4.3, pp. 84-86

03

Critical points and curvature

First-order stationarity is necessary but not sufficient. Second-order curvature distinguishes minima, maxima, saddles, and degenerate cases.

Guided checkpoint

Evaluate each local-optimality statement for a twice-differentiable objective.

Source: Chapter 4, section 4.3, pp. 86-91

Section 03

Newton's method to Constrained optimization language

01

Newton's method

Solving the stationary condition of the second-order Taylor approximation yields the Newton displacement H1g-H^{-1}g.

Guided checkpoint

For a local quadratic approximation with invertible Hessian HH, which step targets its stationary point?

Source: Chapter 4, section 4.3, pp. 90-92

02

Gradient descent in nonconvex terrain

Gradient descent is a local method. Step size and conditioning matter, and nonconvex objectives offer no general global guarantee.

Guided checkpoint

Which statements are justified by the chapter?

Source: Chapter 4, section 4.3, pp. 82-93

03

Constrained optimization language

The generalized Lagrangian supports equality and inequality constraints. Active inequalities and their multipliers are linked by complementary slackness.

Guided checkpoint

Match each concept to its function.

Source: Chapter 4, section 4.4, pp. 93-96

Section 04

A one-dimensional constrained optimum to Linear least squares

01

A one-dimensional constrained optimum

The unconstrained optimum 3 is infeasible. The feasible point closest to 3 lies on the active boundary at x=1x=1.

Guided checkpoint

Minimize (x3)2(x-3)^2 subject to x1x\le 1. What is the optimal xx?

Source: Chapter 4, section 4.4, pp. 93-96

02

Linear least squares

The chapter derives least squares as a constrained optimization example. Matrix factorizations are typically preferable to explicit inversion in numerical implementations.

Guided checkpoint

Judge each statement about minimizing Axb22||Ax-b||_2^2.

Source: Chapter 4, section 4.5, pp. 96-97

Knowledge check

Turn understanding into recall.

The quiz now follows the same concepts in scored form. You can return to this lesson from the quiz whenever a gap appears.