The Modern Mathematics of Deep Learningexplained for non-mathematicians

Matrix pseudoinverse

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.

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.

Consider this concept alongside the project; its source assumptions may differ. These observations do not prove a theorem.

Input: 12 × 2; Held-out evaluation: 102 · #58 · 40.6 mm, 193 mm. Known answer: Adélie; Prediction: Adélie · [≈0.7383, ≈0.2444, ≈0.01737].

Used in these source sections: 2.4 A second descent

Σ⁺ is the Moore–Penrose pseudoinverse of Σ. For a diagonal matrix, invert each nonzero diagonal entry and leave zero entries at zero.

A pseudoinverse also handles singular matrices.

Source formula example

Σ+\Sigma^{+}

illustration · The reciprocal-diagonal rule applies to this diagonal matrix; a general matrix requires a pseudoinverse algorithm.

Symbols

ΣΣ
The sample outer-product matrix.
Σ+Σ⁺
Its Moore–Penrose pseudoinverse.
mm
Positive sample size.

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

  • sigma = [ [2, 0], [0, 0], ]
  • inverse = [ [0.5, 0], [0, 0], ]
  • m = 2

Calculated here

Result expression: { sigma, inverse, scaled: inverse.map((row) => row.map((v) => v / m)) }

Returns

Example result
sigma
array (2 items): [array (2 items): [2, 0], array (2 items): [0, 0]]
inverse
array (2 items): [array (2 items): [0.5, 0], array (2 items): [0, 0]]
scaled
array (2 items): [array (2 items): [0.25, 0], array (2 items): [0, 0]]

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 reciprocal-diagonal rule applies to this diagonal matrix; a general matrix requires a pseudoinverse algorithm.

Source: Inline notation