The Modern Mathematics of Deep Learningexplained for non-mathematicians

A fully connected network

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: 1.2 Learning from examples · 1.2.2 Can the network express the answer? · 2.1 A view through similarity · More source sections

Each layer multiplies its inputs by a weight matrix and adds biases. Apply an activation to hidden layers, then use the result as the next layer input.

These operations define the network prediction.

Source formula example

Φ(1)(x,θ)=W(1)x+b(1),Φˉ(ℓ)(x,θ)=ϱ(Φ(ℓ)(x,θ)),ℓ∈[L−1],andΦ(ℓ+1)(x,θ)=W(ℓ+1)Φˉ(ℓ)(x,θ)+b(ℓ+1),ℓ∈[L−1],\begin{split}\Phi^{(1)}(x,\theta)&=W^{(1)}x+b^{(1)},\\ \bar{\Phi}^{(\ell)}(x,\theta)&=\varrho\big(\Phi^{(\ell)}(x,\theta)\big),\quad\ell\in[L-1],\quad\text{and}\\ \Phi^{(\ell+1)}(x,\theta)&=W^{(\ell+1)}\bar{\Phi}^{(\ell)}(x,\theta)+b^{(\ell+1)},\quad\ell\in[L-1],\end{split}

illustration · This uses one input, two hidden units, one output, and ReLU. Other networks have different matrices, biases, sizes, and activations.

Symbols

W(ℓ)W^{(ℓ)}
Layer ℓ weight matrix with one row per output and one column per input.
b(ℓ)b^{(ℓ)}
Layer ℓ bias vector.
ρρ
Activation applied to hidden-layer entries.

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.x = 1

Calculated here

Result expression: { hiddenBefore, hidden, output }

  • x = input.x Uses: input.x
  • hiddenBefore = [2 * x + 1, -x] Uses: x
  • hidden = hiddenBefore.map((value) => Math.max(0, value)) Uses: hiddenBefore
  • output = hidden[0] + 2 * hidden[1] Uses: hidden

Returns

Example result
hiddenBefore
array (2 items): [3, -1]
hidden
array (2 items): [3, 0]
output
3

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: Source expression