The Modern Mathematics of Deep Learningexplained for non-mathematicians

A weighted generalization bound

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.3 Does it work on new examples?

The left side is the difference between population risk and sample risk. The right side is a bound for a rule with positive weight p(f).

This theorem relates sample size, confidence, and prior weight to a risk bound.

Source formula example

∣R(f)−R^S(f)∣≤ln⁡(1/p(f))+ln⁡(2/δ)2m.|{\mathcal{R}}(f)-\widehat{\mathcal{R}}_{S}(f)|\leq\sqrt{\frac{\ln(1/p(f))+\ln(2/\delta)}{2m}}.

illustration · The code calculates the bound for a supplied positive weight. It does not calculate population risk or prove the probabilistic statement.

Symbols

p(f)p(f)
Prior probability assigned to rule f, chosen before seeing the sample.
δδ
Failure probability in (0,1).
mm
Positive integer number of training examples.

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.weight = 0.5
  • input.delta = 0.5
  • input.m = 4

Calculated here

Result expression: { upperBound: Math.sqrt((Math.log(1 / weight) + Math.log(2 / delta)) / (2 * m)), }

  • weight = input.weight Uses: input.weight
  • delta = input.delta Uses: input.delta
  • m = input.m Uses: input.m

Returns

Example result
upperBound
≈0.5098

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

Result

Enable JavaScript to run this example.

Technical statement

The theorem assumes a countable hypothesis class, a probability distribution p on that class, loss in [0,1] almost surely for each rule, and independent identically distributed training examples. With probability at least 1−δ over the sample, the bound holds simultaneously for every rule. A zero prior weight gives no finite bound; this calculator requires a positive weight.

Source: Source expression