The Modern Mathematics of Deep Learningexplained for non-mathematicians

Population risk after training

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.

Risk and assessment · Distinguish loss on a sample from expected loss.

The fitted rule is evaluated on 102 held-out observations, not used for fitting.

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

The trained rule depends on the sample S. To evaluate its population risk, hold S fixed and average loss over a fresh example Z.

The toy predicts the label in a one-example training sample. A fresh label is +1 with probability p and −1 otherwise.

Conditioning makes clear which randomness comes from training and which comes from new data.

Source formula example

R(fS)=E[L(fS,Z)∣S]{\mathcal{R}}(f_{S})={\mathbbm{E}}\big[{\mathcal{L}}(f_{S},Z)|{S}\big]

exact · The probability is known in this toy. The conditional expectation is not generally equal to a finite test-set mean.

Symbols

SS
The random training sample, held fixed in the conditional expectation.
fSf_S
The rule learned from S.
ZZ
A fresh example from the population.

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.p = 0.25
  • input.trainingLabel = 1

Calculated here

Result expression: { trainedLabel, probabilities: [1 - p, p], populationRisk: risk }

  • p = input.p Uses: input.p
  • trainedLabel = input.trainingLabel Uses: input.trainingLabel
  • risk = trainedLabel === 1 ? 1 - p : p Uses: trainedLabel, p

Returns

Example result
trainedLabel
1
probabilities
array (2 items): [0.75, 0.25]
populationRisk
0.75

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

Result

Enable JavaScript to run this example.

Technical statement

Change the input and run the same code again. The displayed result uses the values shown above.

Source: Conditional risk