A gradient upper comparison
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.
Optimization theory · Study convergence and loss geometry under assumptions.
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: 5.2 When parameters move only a little
Compare the squared gradient to a constant multiple of width divided by sample count times loss.
The source uses an upper estimate to reason about how far training travels.
Source formula example
illustration · The toy constant is not a source constant and does not establish the general high-probability estimate.
Symbols
- Mean squared loss.
- Initialization vector.
- Parameter displacement.
- Positive width and sample count.
- Inequality up to a positive constant.
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
Code changed. Reset to restore this example’s data flow.
You choose
input.displacement= 0.5
Initial values in code
constant=20
Calculated here
Result expression: {
risk,
gradient,
squaredNorm,
widthOverSamples: 1,
constant,
upperBound: constant * risk,
}
a=1 + input.displacementUses:input.displacementrisk=a * aUses:agradient=[2 * a, 2 * a * a]Uses:asquaredNorm=gradient.reduce((sum, v) => sum + v * v, 0)Uses:gradient
Returns
risk- 2.25
gradient- array (2 items): [3, 4.5]
squaredNorm- 29.25
widthOverSamples- 1
constant- 20
upperBound- 45
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
For Φ = awx, x = w = 1, target 0, and a in [0,2], the gradient squared is 4a²(1+a²), at most 20 times the loss. The toy has n = m = 1 and fixes the incoming weight at 1 for evaluation. The constant 20 is chosen only for this input range.
Source: Source expression