Gradient descent step
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.
Learning and parameter updates · Select a rule or update parameters using a learning rule.
The current objective supplies a gradient; training updates the model parameters.
Update
- Input
- Gradient: [≈0.004056, ≈0.01907, ≈0.008327, ≈-0.008829, ≈-0.0138, ≈0.01504, ≈0.004773, ≈-0.005269, ≈-0.02337]; Step size: 0.1
- Output
- [≈-0.2899, ≈-2.054, ≈-1.017, ≈0.6924, ≈1.558, ≈-1.663, ≈-0.4025, ≈0.4955, ≈2.68]
Project operation
The project calculation uses these records; the source formula and example follow below. Code edits run locally; project settings travel between pages.
Gradient → Update → Prediction
Project input
Showing first three entries; the operation receives the complete array. Rounded preview; the operation uses full precision.
Result
[≈-0.2899, ≈-2.054, ≈-1.017] … (9 entries)
Used in these source sections: 1.2.1 Finding better settings · 2.3 The path matters
The gradient gives the direction in which the objective increases fastest. Subtract a scaled gradient to take a step.
For this toy objective r(θ) = θ², the gradient is 2θ.
The step is one basic way to reduce an objective.
Source formula example
illustration · This is one step on a particular quadratic. A step need not reduce every objective for every step size.
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.theta= 2input.rate= 0.1
Calculated here
Result expression: { gradient, next, before: input.theta ** 2, after: next ** 2 }
gradient=2 * input.thetaUses:input.thetanext=input.theta - input.rate * gradientUses:input.theta,input.rate,gradient
Returns
gradient- 4
next- 1.6
before- 4
after- 2.56
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
Change the input and run the same code again. The displayed result uses the values shown above.
Source: Gradient descent