The Modern Mathematics of Deep Learningexplained for non-mathematicians

Projected normalized gradient

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: 2.3 The path matters

Normalize the parameter vector, form the projection matrix, multiply by the smoothed-margin gradient, and divide by the parameter norm.

For one example x=(1,0), y=1 and exponential loss, rβ(θ)=θ₁, so its gradient is (1,0).

The projected update describes changes in parameter direction.

Source formula example

dθ~(t)dt=Pθ~(t)∇θrβ(t)(θ~(t))β(t)withβ(t)≔∥θ(t)∥2andPθ≔Id−θθT,θ∈Rd.\frac{\mathrm{d}\tilde{\theta}(t)}{\mathrm{d}t}=P_{\tilde{\theta}(t)}\frac{\nabla_{\theta}r_{\beta(t)}(\tilde{\theta}(t))}{\beta(t)}\quad\text{with}\quad\beta(t)\coloneqq\|\theta(t)\|_{2}\quad\text{and}\quad P_{\theta}\coloneqq\mathrm{I}_{d}-\theta\theta^{T},\quad\theta\in{\mathbb{R}}^{d}.

illustration · This evaluates one projected vector field. It does not integrate the trajectory or prove general maximum-margin convergence.

Symbols

ββ
Nonzero parameter norm.
θ~θ̃
Parameter vector divided by its norm.
PP
Matrix projecting onto directions orthogonal to the unit parameter vector.

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.u = 3
  • input.v = 4

Initial values in code

  • gradient = [1, 0]

Calculated here

Result expression: { beta, normalized, projection, gradient, rate }

  • theta = [input.u, input.v] Uses: input.u, input.v
  • beta = Math.hypot(...theta) Uses: theta
  • normalized = theta.map((value) => value / beta) Uses: theta, beta
  • projection = normalized.map((value, i) => normalized.map((other, j) => (i === j ? 1 : 0) - value * other), ) Uses: normalized
  • rate = projection.map( (row) => row.reduce((sum, value, i) => sum + value * gradient[i], 0) / beta, ) Uses: projection, gradient, beta

Returns

Example result
beta
5
normalized
array (2 items): [0.6, 0.8]
projection
array (2 items): [array (2 items): [0.64, -0.48], array (2 items): [-0.48, 0.36]]
gradient
array (2 items): [1, 0]
rate
array (2 items): [0.128, -0.096]

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

Result

Enable JavaScript to run this example.

Technical statement

The source derives the evolution by the chain rule for normalized nonzero parameters. The chosen one-sample exponential loss has smoothed margin equal to the first parameter coordinate; hence the gradient is exactly (1,0).

Source: Source expression