The Modern Mathematics of Deep Learningexplained for non-mathematicians

Weighted and Fourier errors

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.

Approximation and depth · Study approximation error and network size under stated conditions.

The project supplies finite observations and fitted parameters. A held-out sample does not establish population bounds or prove a theorem.

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: 3.1 A rule based on distance

The source first rewrites a weighted error using the square root of the probability density. It then uses Fourier energy preservation.

The toy has two equally weighted points and uses a normalized two-point discrete Fourier transform.

The frequency-domain error can reveal which functions are difficult to approximate.

Source formula example

∥Φ−g∥L2(μ)2=∥Φφ−gφ∥L2(Rd)2=∥Φφ^−gφ^∥L2(Rd)2.\|\Phi-g\|_{L^{2}(\mu)}^{2}=\left\|\Phi\varphi-g\varphi\right\|_{L^{2}({\mathbb{R}}^{d})}^{2}=\big\|\widehat{\Phi\varphi}-\widehat{g\varphi}\big\|_{L^{2}({\mathbb{R}}^{d})}^{2}.

illustration · The example uses a normalized finite discrete transform. It does not prove the continuous Plancherel theorem or the depth-separation result.

Symbols

μμ
A measure with density φ² in the source argument.
φφ
Square root of the probability density.
f^\hat{f}
Fourier transform of f.

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 = 2

Initial values in code

  • probabilities = [0.5, 0.5]

Calculated here

Result expression: { weightedError, spatialError: transformedInput.reduce((sum, value) => sum + value ** 2, 0), fourier, frequencyError: fourier.reduce((sum, value) => sum + value ** 2, 0), }

  • difference = [input.first, 0] Uses: input.first
  • weightedError = difference.reduce( (sum, value, i) => sum + probabilities[i] * value ** 2, 0, ) Uses: difference, probabilities
  • transformedInput = difference.map( (value, i) => value * Math.sqrt(probabilities[i]), ) Uses: difference, probabilities
  • fourier = [ (transformedInput[0] + transformedInput[1]) / Math.sqrt(2), (transformedInput[0] - transformedInput[1]) / Math.sqrt(2), ] Uses: transformedInput

Returns

Example result
weightedError
2
spatialError
2
fourier
array (2 items): [1, 1]
frequencyError
2

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

Result

Enable JavaScript to run this example.

Technical statement

The source assumes the functions and square root of the density are sufficiently well behaved for the integrals and Plancherel identity. The toy checks the corresponding finite energy identity; its two-point transform is not the continuous Fourier transform.

Source: Source expression