The Modern Mathematics of Deep Learningexplained for non-mathematicians

A margin-bound example

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: 2.2 Weight size and room to decide

Compare classification risk and surrogate loss, then evaluate the known sample-margin and concentration terms.

A margin bound relates observed training margins to population classification risk.

Source formula example

P[sgn⁡(f(X))≠Y]≤E[Lγsurr(f,Z)]≲1m∑i=1mLγsurr(f,Z(i))+Rm(Lγsurr∘Fa)+ln⁡(1/δ)m≲1m∑i=1m1(−∞,γ)(Y(i)f(X(i)))+Rm(M∘Fa)γ+ln⁡(1/δ)m=1m∑i=1m1(−∞,γ)(Y(i)f(X(i)))+Rm(Fa)γ+ln⁡(1/δ)m.\begin{split}{\mathbbm{P}}[{\operatorname{sgn}}(f(X))\neq Y]\leq{\mathbbm{E}}\big[{\mathcal{L}}^{\mathrm{surr}}_{\gamma}(f,Z)\big]&\lesssim\frac{1}{m}\sum_{i=1}^{m}{\mathcal{L}}^{\mathrm{surr}}_{\gamma}(f,Z^{(i)})+{\mathfrak{R}}_{m}({\mathcal{L}}^{\mathrm{surr}}_{\gamma}\circ{\mathcal{F}}_{{{a}}})+\sqrt{\frac{\ln(1/\delta)}{m}}\\ &\lesssim\frac{1}{m}\sum_{i=1}^{m}\mathds{1}_{(-\infty,\gamma)}(Y^{(i)}f(X^{(i)}))+\frac{{\mathfrak{R}}_{m}(M\circ{\mathcal{F}}_{{a}})}{\gamma}+\sqrt{\frac{\ln(1/\delta)}{m}}\\ &=\frac{1}{m}\sum_{i=1}^{m}\mathds{1}_{(-\infty,\gamma)}(Y^{(i)}f(X^{(i)}))+\frac{{\mathfrak{R}}_{m}({\mathcal{F}}_{{{a}}})}{\gamma}+\sqrt{\frac{\ln(1/\delta)}{m}}.\end{split}

illustration · The singleton class is a finite restriction, not the full network hypothesis class. This check does not establish the source high-probability bound.

Symbols

ff
Classifier score function.
γγ
Positive margin threshold.
δδ
Failure probability in (0,1).
RmRₘ
Rademacher complexity.
M(f,z)M(f,z)
Signed margin Yf(X).
≲≲
Inequality up to an unspecified 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.delta = 0.25

Initial values in code

  • gamma = 0.5
  • margin = 1
  • classificationRisk = 0
  • surrogateLoss = 0
  • signs = [-1, 1]

Calculated here

Result expression: { classificationRisk, surrogateLoss, empiricalBelowMargin, lossComplexity, marginComplexity, classComplexity, contractionTerm, concentration, theoremConstants: null, fullUpperBounds: null, }

  • empiricalBelowMargin = margin < gamma ? 1 : 0 Uses: margin, gamma
  • lossComplexity = complexity(surrogateLoss) Uses: complexity, surrogateLoss
  • marginComplexity = complexity(margin) Uses: complexity, margin
  • classComplexity = complexity(1) Uses: complexity
  • contractionTerm = classComplexity / gamma Uses: classComplexity, gamma
  • concentration = Math.sqrt(Math.log(1 / input.delta)) Uses: input.delta

Returns

Example result
classificationRisk
0
surrogateLoss
0
empiricalBelowMargin
0
lossComplexity
0
marginComplexity
1
classComplexity
1
contractionTerm
2
concentration
≈1.177
… (10 items)

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

Result

Enable JavaScript to run this example.

Technical statement

The invented distribution has one atom (X,Y)=(1,1); the toy class contains only f(x)=1, and m=1. The margin is 1, γ=1/2, and both classification risk and surrogate loss are zero. Under the source absolute-value definition, the zero-loss class has Rademacher complexity 0, while the singleton margin and score classes each have complexity 1: for either random sign, the absolute signed value is 1. The score complexity divided by γ is 2. The source high-probability bound is uniform over its network class and uses unspecified positive constants; the complete numeric bounds therefore remain unavailable.

Source: Source expression