The Modern Mathematics of Deep Learningexplained for non-mathematicians

Sum and mean

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.

Vectors and matrices · Combine numbers using vector and matrix operations.

Project vectors have two features; the training matrix has n rows and two columns. Mathematical tools may operate on these values when their assumptions apply.

Mean training loss

Input
12 Loss
Output
≈0.228

Project operation

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

Loss → Mean training loss → Objective

Project input

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

input.losses · Loss
[≈0.005482, ≈1.012, ≈0.1422] … (12 entries)

Result

≈0.228

Teaching example; no specific paper passage attached.

Add the numbers, then divide by how many there are. The symbol Σ asks us to add terms.

A mean summarizes a finite set of values.

Source formula example

1m∑i=1mxi\frac{1}{m}\sum_{i=1}^{m}x_i

exact · The result is exact for these finite toy inputs, apart from ordinary computer rounding.

Symbols

mm
Number of values, a positive integer.
xix_i
Value at position i, counting from one.

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

Calculated here

Result expression: { sum, mean: sum / values.length }

  • values = [input.first, 2, 3] Uses: input.first
  • sum = values.reduce((total, value) => total + value, 0) Uses: values

Returns

Example result
sum
6
mean
2

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: Teaching example