Read the effect of a sigmoid on a logit

Read a complete operation before typing its result. · 184 words

In binary classification, a logit z is an unrestricted real score, often produced by a final linear layer. The sigmoid function s(z) = 1/(1 + e^(-z)) converts that score into a probability. For z = 0, s(z) = 0.5; for z = 2, it is about 0.881; and for z = -2, it is about 0.119. The mapping is monotone, meaning that increasing the logit increases the probability. However, it is nonlinear, so equal changes in the logit do not produce equal changes in probability.

The local effect of a logit is measured by ds/dz = s(1 - s). At z = 0, the slope is 0.25, the sigmoid's steepest point. At z = 2, the slope is about 0.105, so the sigmoid changes more slowly near saturation. Another useful view is the odds p/(1 - p) = e^z. Raising the logit by 1 multiplies the odds by e, about 2.718, while lowering it by 1 divides the odds by e. For example, z = 0 gives p = 0.5 and odds 1, whereas z = 1 gives p = 0.731 and odds 2.718.

Check your recall

If a sigmoid logit increases from 0 to 1, how do the probability and odds change?

Check your answer

The probability increases from 0.5 to about 0.731, and the odds increase from 1 to e, about 2.718.

Sources and credits

Original KeyTouch lesson. Background reading · Google · Neural networks.