The Modern Mathematics of Deep Learningexplained for non-mathematicians

Dot product

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.

Project operation

Output: ≈1.618

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 → Project operation → Prediction

Project input

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

input.vector · Features
[1, ≈-0.6715, ≈-0.5215]
input.weights · Model
[≈-0.2895, ≈-2.052, ≈-1.016]

Result

≈1.618

Used in these source sections: 1.1 A note on symbols

Multiply matching entries and add the products. Both lists must have the same length.

A dot product gives a linear prediction.

Source formula example

⟨x,θ⟩=∑j=1dxjθj\langle x,\theta\rangle=\sum_{j=1}^{d}x_j\theta_j

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

Symbols

dd
Number of entries in each vector.
x,θx,θ
Real vectors with d 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

Initial values in code

  • theta = [3, 4]

Calculated here

Result expression: { products, dot: products.reduce((a, b) => a + b, 0) }

  • x = [input.x, 2] Uses: input.x
  • products = x.map((value, i) => value * theta[i]) Uses: x, theta

Returns

Example result
products
array (2 items): [3, 8]
dot
11

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