Sigmoid

Activation · node type · Sigmoid, HardSigmoid

Squashes any number into the range 0 to 1, so it can be read as a probability or used as a gate.

Also called Logistic function, Hard sigmoid

Move the input and compare activation functions. The gradient is what training sees: where it is flat, learning stalls.
-4-224-22

f(1.00) = 0.731

Figure 1. Try it: every number is computed in your browser from the formula below.

What it does

The sigmoid maps large negative inputs close to 0, large positive inputs close to 1, and 0 to exactly 0.5. As a final layer it turns one logit into a yes/no probability, for example whether a frame contains speech or a pixel belongs to a person. Inside recurrent cells it acts as a gate that decides how much of a signal to let through. Because it flattens out at both ends, a bias change of +2 near the middle moves the output a lot, while the same change far from zero barely moves it. Hard sigmoid replaces the curve with straight lines for speed.

Formula

σ(x) = 1 / (1 + e−x)σ(0) = 0.5, σ(x) + σ(−x) = 1HardSigmoid(x) = max(0, min(1, α·x + β))

Shapes and parameters

Shapes
Any shape in, the same shape out.
Parameters
None. An activation is a fixed function applied to every element, so it adds no parameters.
Used for
Binary and multi-label outputs, saliency and matting masks, voice activity and shot-cut probabilities, LSTM and GRU gates, and the drive units of the Meadow animals.

Figure 2. Sigmoid inside Meadow animal brain, a real model in WeightSpace. The 2 outlined nodes are Sigmoid; select any node for its shapes and parameters.

Figure 3. The typed ports of Sigmoid, in the same format as every model drawing. Letters such as N or C stand for any size.

In WeightSpace

No parameters of its own. Several catalog edits change the logit just before a sigmoid (speech presence, cut probability, foreground alpha), so a delta moves the output most when the logit sits near zero. In Meadow, each drive is a sigmoid of a weighted sum of senses, and those weights are editable.