The Modern Mathematics of Deep Learningexplained for non-mathematicians

Classification margin

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

The signed margin of f on (x,y) is y f(x). The parameter γ is a positive margin threshold.

A positive margin indicates agreement with a ±1 label.

Source formula example

M(f,z)≔yf(x)M(f,z)\coloneqq yf(x)

illustration · This checks one example; a training margin may instead take the minimum over many examples.

Symbols

ff
A real-valued predictor.
z=(x,y)z=(x,y)
An input and label pair.
γγ
A positive threshold.
MM
The signed margin.

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

  • y = -1
  • prediction = -2
  • gamma = 1

Calculated here

Result expression: { y, prediction, gamma, margin, meetsThreshold: margin >= gamma }

  • margin = y * prediction Uses: y, prediction

Returns

Example result
y
-1
prediction
-2
gamma
1
margin
2
meetsThreshold
true

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

Result

Enable JavaScript to run this example.

Technical statement

The numerical values are invented. This checks one example; a training margin may instead take the minimum over many examples.

Source: Inline notation