The Sigmoid Neuron — a Smooth Perceptron
On this page 6 headings
From a score to a soft prediction
Use weight 2, bias −1, and input 0.5.
First calculate the weighted score.
Pass the score through the sigmoid.
A larger input produces a larger score.
What changed? Unlike a hard threshold, sigmoid output changes smoothly as the score changes.
Quick check: What does the sigmoid output when its score is zero?
0.5, regardless of how the weights and inputs produced that zero score.
Swipe long formulas, tables or code sideways to see the rest.
Start here A perceptron says a hard “yes” or “no”. A movie rated 0.51 → like, 0.49 → dislike. That is too harsh. The sigmoid neuron replaces the sudden jump with a smooth S-shaped curve, and gives a probability instead of a hard 0/1. This one change is what makes learning with calculus (gradient descent) possible.
Week 1 was about Boolean functions: inputs in {0, 1}ⁿ, output in {0, 1}.
Now we want arbitrary functions , where:
- (real-number inputs), and
- (real-number output).
Can a network (approximately) represent such functions? Before answering, we must move from perceptrons to sigmoid neurons.
Recall: a perceptron fires if the weighted sum is greater than the threshold .
Lecture example — critics’ rating Decide like/dislike using only criticsRating, a number between 0 and 1. Threshold 0.5 (so ), weight .
- criticsRating like
- criticsRating dislike
A tiny difference of 0.02 flips the decision completely. That seems harsh.
This is not because of this example or these numbers. It is a property of the perceptron itself: it behaves like a step function. When crosses , the output suddenly jumps from 0 to 1.
In real life we expect a smoother decision that changes gradually from 0 to 1.
The most common sigmoid function is the logistic function:
We write (sigma) for it: .
Feel the numbers (z is the weighted sum including the bias):
| z | ||
|---|---|---|
| −4 | 54.6 | |
| −1 | 2.718 | |
| 0 | 1 | 0.5 |
| 1 | 0.368 | |
| 4 | 0.018 |
What changed:
- No sharp jump around the threshold .
- The output is a real number between 0 and 1, which we can read as a probability.
- Instead of “like/dislike”, we get “probability of liking the movie”.
Everyday example A weather app says “70% chance of rain” instead of just “rain / no rain”. The sigmoid neuron answers in the same way.
| Perceptron | Sigmoid (logistic) neuron | |
|---|---|---|
| Formula | if , else 0 | |
| Output | 0 or 1 | any value between 0 and 1 |
| Shape | step | smooth S-curve |
| Smooth? | No | Yes, continuous |
| Differentiable? | No — not at the threshold | Yes, everywhere |
Why “differentiable” matters: to learn weights with calculus, we need the slope (derivative) of the output with respect to each weight. A step has no useful slope (flat everywhere, a jump at one point). The sigmoid has a smooth slope everywhere. That is what gradient descent needs.
In one line: The sigmoid neuron is a perceptron with a smooth S-curve instead of a step; its output is a probability and it is differentiable.
Exam words: step function, sigmoid function, logistic function, , smooth, continuous, differentiable, probability output, threshold .
