The Modern Mathematics of Deep Learningexplained for non-mathematicians

Approximation risk and function distance

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.

Generalization and risk bounds · Relate sample behavior to population risk under stated 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: 1.2 Learning from examples

Compare excess risk, the best squared L² distance, and the squared uniform distance.

This example makes the source statement computable on a finite model.

Source formula example

εapprox=R(fF∗)−R∗=(∗)∫X(fF∗(x)−f∗(x))2 dPX(x)=(∗)min⁡f∈F∥f−f∗∥L2(PX)2≤min⁡f∈F∥f−f∗∥L∞(X)2,\begin{split}{\varepsilon}^{\mathrm{approx}}={\mathcal{R}}(f^{*}_{\mathcal{F}})-{\mathcal{R}}^{*}&\overset{(*)}{=}\int_{{\mathcal{X}}}(f^{*}_{\mathcal{F}}(x)-f^{*}(x))^{2}\,\mathrm{d}{\mathbbm{P}}_{X}(x)\\ &\overset{(*)}{=}\min_{f\in{\mathcal{F}}}\|f-f^{*}\|_{L^{2}({\mathbbm{P}}_{X})}^{2}\\ &\leq\min_{f\in{\mathcal{F}}}\|f-f^{*}\|_{L^{\infty}(\mathcal{X})}^{2},\end{split}

illustration · The finite example does not establish the identity for all regression distributions.

Symbols

R∗R*
Bayes regression risk.
f∗f*
Bayes conditional-mean predictor.
f∗Ff*F
Best predictor in F.
PxPₓ
Input distribution.
∥⋅∥L2,∥⋅∥L∞\Vert ·\Vert L²,\Vert ·\Vert L∞
Mean-square and essential-supremum function norms.

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

Initial values in code

  • target = [0, 2]
  • candidates = [0, 1]

Calculated here

Result expression: { risks, best, approximationRisk: Math.min(...risks), l2Squared: differences.reduce((s, v) => s + v * v, 0) / 2, infinitySquared: Math.max(...differences.map(Math.abs)) ** 2, }

  • risks = candidates.map(risk) Uses: candidates, risk
  • best = candidates[risks.indexOf(Math.min(...risks))] Uses: candidates, risks
  • differences = target.map((y) => best - y) Uses: target, best

Returns

Example result
risks
array (2 items): [2, 1]
best
1
approximationRisk
1
l2Squared
1
infinitySquared
1

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

Result

Enable JavaScript to run this example.

Technical statement

The toy distribution is uniform on two inputs with deterministic targets [0,2], and F contains the constants 0 and 1. Thus Bayes risk is zero, the best class risk is 1, and both norm squares are 1. The source assumes squared-loss regression and a minimizer in the class.

Source: Source expression