The Modern Mathematics of Deep Learningexplained for non-mathematicians

A gradient upper comparison

Penguin learning project

The project uses 342 complete Palmer penguin records: 240 training-pool and 102 held-out rows. The selected training rows determine feature scaling and model parameters. Source CSV

This project trains weights with softmax, unlike the homepage lab, which uses nearest species averages. Same penguin measurements; different classification methods. Predictions can differ.

Optimization theory · Study convergence and loss geometry under assumptions.

The project supplies finite observations and fitted parameters. A held-out sample does not establish population bounds or prove a theorem.

Consider this concept alongside the project; its source assumptions may differ. These observations do not prove a theorem.

Input: 12 × 2; Held-out evaluation: 102 · #58 · 40.6 mm, 193 mm. Known answer: Adélie; Prediction: Adélie · [≈0.7383, ≈0.2444, ≈0.01737].

Used in these source sections: 5.2 When parameters move only a little

Compare the squared gradient to a constant multiple of width divided by sample count times loss.

The source uses an upper estimate to reason about how far training travels.

Source formula example

∥∇θr(Θ+θˉ)∥22≲nmr(Θ+θˉ)\|\nabla_{\theta}{r}(\Theta+\bar{\theta})\|_{2}^{2}\lesssim\frac{n}{m}{r}(\Theta+\bar{\theta})

illustration · The toy constant is not a source constant and does not establish the general high-probability estimate.

Symbols

rr
Mean squared loss.
ΘΘ
Initialization vector.
θˉθ̄
Parameter displacement.
n,mn,m
Positive width and sample count.
≲≲
Inequality up to a positive constant.

Source formula example

This source example uses its own inputs and assumptions. Editing it does not change the project.

Edit a value or the code, then run the example. This is a finite demonstration, not a proof of the paper’s theorem.

This example’s data flow

You choose

  • input.displacement = 0.5

Initial values in code

  • constant = 20

Calculated here

Result expression: { risk, gradient, squaredNorm, widthOverSamples: 1, constant, upperBound: constant * risk, }

  • a = 1 + input.displacement Uses: input.displacement
  • risk = a * a Uses: a
  • gradient = [2 * a, 2 * a * a] Uses: a
  • squaredNorm = gradient.reduce((sum, v) => sum + v * v, 0) Uses: gradient

Returns

Example result
risk
2.25
gradient
array (2 items): [3, 4.5]
squaredNorm
29.25
widthOverSamples
1
constant
20
upperBound
45

Read numbers from input and return the result. JavaScript basics.

Result

Enable JavaScript to run this example.

Technical statement

For Φ = awx, x = w = 1, target 0, and a in [0,2], the gradient squared is 4a²(1+a²), at most 20 times the loss. The toy has n = m = 1 and fixes the incoming weight at 1 for evaluation. The constant 20 is chosen only for this input range.

Source: Source expression