The Modern Mathematics of Deep Learningexplained for non-mathematicians

Parameter gradients

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.

Functions and derivatives · Describe maps and how their outputs change.

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.

Gradient

Input
Objective: ≈0.237
Output
[≈0.004056, ≈0.01907, ≈0.008327, ≈-0.008829, ≈-0.0138, ≈0.01504, ≈0.004773, ≈-0.005269, ≈-0.02337]

Project operation

The project calculation uses these records; the source formula and example follow below. Code edits run locally; project settings travel between pages.

Objective → Gradient → Update

Project input

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

input.features · Features
[[≈-1.946, ≈-1.283], [≈-0.6098, ≈-1.029], [≈-0.4454, ≈0.9162]] … (12 entries)
input.targets · Observations
[0, 1, 2] … (12 entries)
input.weights · Model
[≈-0.2895, ≈-2.052, ≈-1.016] … (9 entries)
input.alpha · Project settings or constant
0.001
input.task · Project settings or constant
classification

Result

[≈0.004056, ≈0.01907, ≈0.008327] … (9 entries)

Used in these source sections: 1.2.1 Finding better settings · 1.2.3 Does it work on new examples? · 2.1 A view through similarity

The parameter gradient lists the partial derivatives of the output with respect to each network parameter.

It describes how the output responds to parameter changes.

Source formula example

∇θΦa(x,θ)\nabla_{\theta}\Phi_{{a}}(x,\theta)

illustration · This gradient is exact for the chosen linear network; other networks require their own derivatives.

Symbols

ΦΦ
A network function.
θθ
Its parameter vector.
∇θΦ∇θΦ
Gradient with respect to parameters.
xx
A network input.

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

  • x = 3
  • theta = [2, 1]

Calculated here

Result expression: { x, theta, output, gradient }

  • output = theta[0] * x + theta[1] Uses: theta, x
  • gradient = [x, 1] Uses: x

Returns

Example result
x
3
theta
array (2 items): [2, 1]
output
7
gradient
array (2 items): [3, 1]

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

Result

Enable JavaScript to run this example.

Technical statement

The numerical values are invented. This gradient is exact for the chosen linear network; other networks require their own derivatives.

Source: Inline notation