The Modern Mathematics of Deep Learningexplained for non-mathematicians

Output-weight gradient and kernel

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

For squared loss, the output-weight gradient is twice the mean of each error times its feature vector.

The full gradient contains the output-weight gradient, which provides a lower bound on its squared norm.

Source formula example

∥∇θr(Θ)∥22≥4m2∥∑i=1m∇θ(2)Φ(x(i),Θ)(Φ(x(i),Θ)−y(i))∥22=4m2((Φ(x(i),Θ)−y(i))i=1m)TKˉΘ(Φ(x(j),Θ)−y(j))j=1m,\begin{split}\|\nabla_{\theta}{r}(\Theta)\|_{2}^{2}&\geq\frac{4}{m^{2}}\Big\|\sum_{i=1}^{m}\nabla_{\theta^{(2)}}\Phi(x^{(i)},\Theta)(\Phi(x^{(i)},\Theta)-y^{(i)})\Big\|_{2}^{2}\\ &=\frac{4}{m^{2}}\big((\Phi(x^{(i)},\Theta)-y^{(i)})_{i=1}^{m}\big)^{T}\bar{K}_{\Theta}(\Phi(x^{(j)},\Theta)-y^{(j)})_{j=1}^{m},\end{split}

illustration · This exact one-sample calculation does not establish the inequality for arbitrary networks or a training convergence result.

Symbols

rr
Mean squared training loss.
ΘΘ
Network parameter vector.
KˉK̄
Output-weight gradient Gram matrix.
mm
Positive training sample count.
Φ(x(i),Θ)−y(i)Φ(x⁽ⁱ⁾,Θ)−y⁽ⁱ⁾
Residual for training example i.

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.outputWeight = 1

Initial values in code

  • w = 1
  • x = 1

Calculated here

Result expression: { fullGradient, fullSquaredNorm: fullGradient.reduce((sum, v) => sum + v * v, 0), gram, quadratic, outputGradientSquared, }

  • a = input.outputWeight Uses: input.outputWeight
  • error = a * w * x Uses: a, w, x
  • fullGradient = [2 * error * w * x, 2 * error * a * x] Uses: error, w, x, a
  • gram = (w * x) ** 2 Uses: w, x
  • quadratic = error * gram * error Uses: error, gram
  • outputGradientSquared = 4 * quadratic Uses: quadratic

Returns

Example result
fullGradient
array (2 items): [2, 2]
fullSquaredNorm
8
gram
1
quadratic
1
outputGradientSquared
4

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

Result

Enable JavaScript to run this example.

Technical statement

The invented one-unit network is Φ(x) = awx, the single input is x = 1, and its target is zero. Its full parameter gradient has two entries. With m = 1, 4/m² is 4. Both sides of the first inequality and the Gram equality are computed. The source’s training discussion assumes a smooth, non-affine activation, distinct training inputs, quadratic loss, and independent Gaussian hidden and output initial parameters with variance 1/n. Its high-probability and convergence statements require the additional width, neighborhood, and step-size conditions stated in that discussion.

Source: Source expression