A single neuron
A parameterized unit combines inputs; the pilot begins with a scalar affine prediction.
Shared AI lesson · One neuron learning
The shop charges 3 credits for each notebook, plus 2 for packing. The computer uses the same kind of rule, but starts with different numbers. It changes those numbers to reduce its mistakes. The price per notebook is called a weight. The fixed extra amount is called a bias.
Compare your prediction and explanation with the observed numbers.
In the classifier, parameters will shape a boundary rather than a price line. Keep the same question: which input changes which intermediate value, and how does that change the output?
The price model uses identity: it leaves the total unchanged. An activation function is the rule that turns that total into the output.
Another rule, ReLU, keeps positive totals and replaces negative totals with zero. Zero stays zero. Compare the same total under both rules.
Activation: ReLU · keep positive totals; replace negative totals with zero
-2 × 1 + (0) = -2; ReLU(-2) = 0
For total -2, identity gives -2; ReLU gives 0.
Compare this activity with a reference you choose. Hints use only the public settings and results listed below, stay on this device, and do not assess your understanding.
Why add this rule? With one input, stacking only multiply-and-add calculations still produces a straight-line relationship. ReLU introduces a bend at zero. Nonlinear rules like this let networks represent relationships a straight line cannot.
This temporary illustration does not train or change your saved price model. Different tasks use different activation rules; ReLU is not required for every output. You will explore its role further in the two-switch lesson.
The computer uses one rule for every order: multiply the number of notebooks by its price guess, then add its packing-fee guess.
At first, those guesses can be wrong. Each learning step changes them to make the example prices closer. That is what “learning” means in this small example.
The price-per-notebook setting is called a weight. The fixed packing fee is called a bias. Together, this little calculation is a simple kind of neuron.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
A neuron is a small calculation with adjustable numbers. In the shop example, multiply the number of items by the price per item, then add the packing fee. The model calls these two adjustable numbers the weight and bias. Increasing the weight makes the price rise faster as you add items; increasing the bias adds the same amount to every prediction.
For three items at three credits each and a two-credit packing fee, the prediction is 3 × 3 + 2 = 11 credits. The playground’s four supplied prices are 5, 8, 11 and 14 credits for one through four items.
Learning compares predicted prices with the supplied prices, measures the mistakes and adjusts both numbers. The error score here is the average of squared mistakes. A large mistake therefore matters more than a small one.
Fitting these four fictional prices does not prove that the model will predict other prices well. Its straight line cannot express every possible pattern.
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
Imagine a shop where every item costs the same amount, plus a fixed packing fee. A simple model can estimate the total price from the number of items.
It needs just two adjustable numbers: a weight for the price per item, and a bias for the fixed fee. Together, they form our first neuron.
This is a made-up price example designed to make every calculation visible. Real prices depend on many more things.
In the playground, the four example prices are 5, 8, 11, and 14 credits for one through four items. The model begins with a poor guess: a weight of 1 and a bias of 0.
Training compares its predictions with the examples. It measures the errors, calculates how the weight and bias affect those errors, and adjusts both a little. Repeating this process is gradient descent.
This lesson uses a neuron with a linear output: its graph is a straight line. Later, we’ll add nonlinear activation functions and connect neurons into layers, so the network can represent more complicated patterns.
A perfect fit to these four examples only tells us the model fits this tiny training set. We still need new examples to check generalization.
For each example, calculate prediction minus target. The weight gradient averages twice that error times the input; the bias gradient averages twice the error. Both updates use the same old parameters.
At weight 1 and bias 0, the gradients are −40 and −14. One step gives weight 1.8 and bias 0.28. The average squared error falls from 54 to 24.0784.
Keep a private reminder for yourself.
Loading your journal…
Open the standalone neuron playground
Use a connection to review, then return.
A parameterized unit combines inputs; the pilot begins with a scalar affine prediction.
A single neuron can review Linear and affine functions.
The first neuron begins with input times weight plus bias. Comparing weight with slope and bias with a starting value makes that calculation visible.
Neural networks extends A single neuron.
Trace one parameterized unit before composing layers. The XOR lesson then shows why nonlinear activations matter: stacking affine rules alone still gives an affine rule.
11 concepts in this cross-subject pilot, not a complete curriculum graph. The existing AI lesson map and progress records remain separate and available below or through AI discovery.