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.
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 constant0.001input.task· Project settings or constantclassification
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
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.
- 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
Code changed. Reset to restore this example’s data flow.
Initial values in code
x=3theta=[2, 1]
Calculated here
Result expression: { x, theta, output, gradient }
output=theta[0] * x + theta[1]Uses:theta,xgradient=[x, 1]Uses:x
Returns
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
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