The Modern Mathematics of Deep Learningexplained for non-mathematicians

A linear prediction rule

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.

Classification predicts three species; Ridge predicts body mass in grams using the same observations. These are separate models. Training predictions feed the objective; 102 separate test predictions never update the weights.

Prediction rules and layers · Describe or apply prediction rules, layers and parameters.

The project uses a linear rule with two features. The fitted weights produce scores or normalized mass.

Prediction

Input
Training: 12 × 2
Output
[Species: Adélie · Probabilities: [≈0.9945, ≈0.005412, ≈0.00005477], Species: Adélie · Probabilities: [≈0.6338, ≈0.3635, ≈0.002677], Species: Gentoo · Probabilities: [≈0.1023, ≈0.03028, ≈0.8674]] … (12 entries)

Project operation

The project calculation uses these records; the source formula and example follow below. Code edits run locally; project settings travel between pages.

Features → Prediction → Loss

Project input

Showing first three entries; the operation receives the complete array. Rounded preview; the operation uses full precision.

input.features · Features
[[≈-1.946, ≈-1.283], [≈-0.6098, ≈-1.029], [≈-0.4454, ≈0.9162]] … (12 entries)
input.weights · Model
[≈-0.2895, ≈-2.052, ≈-1.016] … (9 entries)
input.task · Project settings or constant
classification
input.targetMean · Observations
null
input.targetScale · Observations
null

Result

[Species: Adélie · Probabilities: [≈0.9945, ≈0.005412, ≈0.00005477], Species: Adélie · Probabilities: [≈0.6338, ≈0.3635, ≈0.002677], Species: Gentoo · Probabilities: [≈0.1023, ≈0.03028, ≈0.8674]] … (12 entries)

Used in these source sections: 2.3 The path matters

The dot in ⟨θ, ·⟩ is a placeholder for an input vector. The function returns the dot product of θ and that input.

A fixed weight vector defines a linear predictor.

Source formula example

⟨θ,⋅⟩\langle\theta,\cdot\rangle

illustration · The example uses two-dimensional vectors.

Symbols

θθ
A real weight vector.
⋅·
A placeholder for a matching input vector.
⟨θ,⋅⟩⟨θ,·⟩
The resulting linear function.

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

  • theta = [2, 1]
  • x = [3, 4]

Calculated here

Result expression: { theta, x, prediction: theta.reduce((s, t, i) => s + t * x[i], 0) }

Returns

Example result
theta
array (2 items): [2, 1]
x
array (2 items): [3, 4]
prediction
10

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

Result

Enable JavaScript to run this example.

Technical statement

The numerical values are invented. The example uses two-dimensional vectors.

Source: Inline notation