The Modern Mathematics of Deep Learningexplained for non-mathematicians

Mean surrogate loss

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.

Objectives · Combine losses and penalties into a criterion for parameters or rules.

Project predictions and known answers produce losses. Classification uses cross-entropy and α/2 times squared non-bias weights; Ridge uses normalized-mass MSE and α times all squared coefficients, including the intercept.

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

Evaluate the surrogate loss on each training example, then average.

A surrogate can replace a discontinuous classification error during optimization.

Source formula example

1m∑i=1mLsurr(f,z(i)),\frac{1}{m}\sum_{i=1}^{m}{\mathcal{L}}^{\mathrm{surr}}(f,z^{(i)}),

exact · This finite sample mean is not the population risk.

Symbols

LsurrLˢᵘʳʳ
Surrogate loss on one example.
ff
Prediction function.
z(i)z⁽ⁱ⁾
Training example i.
mm
Number of 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.score = 0

Initial values in code

  • labels = [1, -1]

Calculated here

Result expression: { losses, mean: losses.reduce((a, b) => a + b, 0) / losses.length }

  • scores = [input.score, 0] Uses: input.score
  • losses = scores.map((v, i) => Math.log(1 + Math.exp(-labels[i] * v))) Uses: scores, labels

Returns

Example result
losses
array (2 items): [≈0.6931, ≈0.6931]
mean
≈0.6931

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

Result

Enable JavaScript to run this example.

Technical statement

The invented sample has two labels and uses logistic surrogate loss.

Source: Source expression