The Modern Mathematics of Deep Learningexplained for non-mathematicians

Outer product and transpose

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, ≈-0.6715, ≈-0.5215], [≈-0.6715, ≈0.4509, ≈0.3502], [≈-0.5215, ≈0.3502, ≈0.272]]

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

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]

Result

[[1, ≈-0.6715, ≈-0.5215], [≈-0.6715, ≈0.4509, ≈0.3502], [≈-0.5215, ≈0.3502, ≈0.272]]

Used in these source sections: 2.4 A second descent

The transpose changes a column vector into a row. Their product is a matrix of pairwise entry products.

Outer products appear in second-moment matrices.

Source formula example

E[XXT]{\mathbbm{E}}[XX^{T}]

illustration · The result uses this finite distribution. General distributions require an expectation over all possible vectors.

Symbols

XX
A real column vector.
XTXᵀ
Its transpose.
XXTXXᵀ
The square outer-product matrix.

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

  • vectors = [ [1, 0], [0, 2], ]
  • probabilities = [0.5, 0.5]

Calculated here

Result expression: { vectors, probabilities, moment }

  • moment = [0, 1].map((i) => [0, 1].map((j) => vectors.reduce((s, x, k) => s + probabilities[k] * x[i] * x[j], 0)), ) Uses: vectors, probabilities

Returns

Example result
vectors
array (2 items): [array (2 items): [1, 0], array (2 items): [0, 2]]
probabilities
array (2 items): [0.5, 0.5]
moment
array (2 items): [array (2 items): [0.5, 0], array (2 items): [0, 2]]

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

Result

Enable JavaScript to run this example.

Technical statement

The numerical values in this example are invented. The result uses this finite distribution. General distributions require an expectation over all possible vectors.

Source: Inline notation