The Modern Mathematics of Deep Learningexplained for non-mathematicians

A sampled threshold feature

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.

Features · Transform inputs into features used by a rule.

The project scales bill and flipper measurements using training-row means and scales; its feature vector has two entries.

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: 4.2 Approximating with random pieces

Divide ξ by its length, form its dot product with x, then evaluate the two strict-positive indicators. Multiply their difference by a sign.

The toy uses one-dimensional x and ξ and chooses the sign +1. It also evaluates a two-feature list with directions −1 and +1. At zero the strict-positive indicator returns zero.

These features occur in the source’s sampling argument.

Source formula example

Γ(ξ,ξ~)≔s(ξ,ξ~)(1(0,∞)(−⟨ξ/∥ξ∥2,⋅⟩−ξ~)−1(0,∞)(⟨ξ/∥ξ∥2,⋅⟩−ξ~))withs(ξ,ξ~)∈{−1,1}.\Gamma(\xi,\tilde{\xi})\coloneqq s(\xi,\tilde{\xi})(\mathds{1}_{(0,\infty)}(-\langle\xi/\|\xi\|_{2},\cdot\rangle-\tilde{\xi})-\mathds{1}_{(0,\infty)}(\langle\xi/\|\xi\|_{2},\cdot\rangle-\tilde{\xi}))\quad\text{with}\quad s(\xi,\tilde{\xi})\in\{-1,1\}.

illustration · This is one one-dimensional feature with a chosen sign. It does not compute the expectation or establish the approximation theorem. The expression requires ξ ≠ 0.

Symbols

ξξ
A nonzero real vector used for the normalized direction.
ξ~ξ̃
A real threshold.
ss
A sign in {−1,1}; this toy chooses +1.

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.xi = 1
  • input.x = 1
  • input.threshold = 0.5

Calculated here

Result expression: { direction, projection, negativeIndicator, positiveIndicator, feature: negativeIndicator - positiveIndicator, featureList, }

  • direction = input.xi / Math.abs(input.xi) Uses: input.xi
  • projection = direction * input.x Uses: direction, input.x
  • negativeIndicator = -projection - input.threshold > 0 ? 1 : 0 Uses: projection, input.threshold
  • positiveIndicator = projection - input.threshold > 0 ? 1 : 0 Uses: projection, input.threshold
  • featureList = [-1, 1].map( (dir) => (-dir * input.x - input.threshold > 0 ? 1 : 0) - (dir * input.x - input.threshold > 0 ? 1 : 0), ) Uses: input.x, input.threshold

Returns

Example result
direction
1
projection
1
negativeIndicator
0
positiveIndicator
1
feature
-1
featureList
array (2 items): [1, -1]

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: Threshold feature