Population risk of network parameters
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.
Risk and assessment · Distinguish loss on a sample from expected loss.
The fitted rule is evaluated on 102 held-out observations, not used for fitting.
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.1 The shape of training loss
Evaluate a parameterized network on every possible example, compute its loss, and take the probability-weighted mean.
This is the population-risk version of the parameter objective r.
Source formula example
illustration · The probabilities specify an invented fully enumerated population; a finite training sample alone would not determine population risk.
Symbols
- Population risk as a function of network parameters.
- Expectation of the loss over the example distribution.
- Network prediction function.
- Random training or test example.
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= 1
Initial values in code
examples=[ { x: 1, y: 2 }, { x: 2, y: 4 }, ]probabilities=[0.5, 0.5]
Calculated here
Result expression: { examples, probabilities, predictions, losses, risk }
theta=input.thetaUses:input.thetapredictions=examples.map((z) => theta * z.x)Uses:examples,thetalosses=examples.map((z, i) => (predictions[i] - z.y) ** 2)Uses:examples,predictionsrisk=losses.reduce((sum, v, i) => sum + probabilities[i] * v, 0)Uses:losses,probabilities
Returns
examples- array (2 items): [object (2 items), object (2 items)]
probabilities- array (2 items): [0.5, 0.5]
predictions- array (2 items): [1, 2]
losses- array (2 items): [1, 4]
risk- 2.5
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
The toy distribution assigns equal probability to two input-target pairs and uses Φ(x,θ)=θx with squared loss. The weighted sum is the exact population expectation for this finite distribution. The source footnote allows either population or empirical risk as the objective.
Source: Source expression