Sigmoid 输出

Sigmoid Output Calculator

Map any real number through the sigmoid function and see where it falls relative to the classification threshold.

📐 计算公式 / 原理
σ(z) = 1/(1 + e^(−z));对数几率 logit = ln[p/(1 − p)] = z
Sigmoid 把任意实数压到 (0,1),输出可直接当概率用;其导数 σ′=σ(1−σ),在 |z| 较大时趋于 0,是深层网络梯度消失的根源之一,所以隐藏层现多改用 ReLU 系。阈值不必固定 0.5,应按业务代价调整。

📐 计算公式与说明

Sigmoid 分类口径(与上方 σ(z) 公式互补):σ(z)=1÷(1+e^(−z)),输出概率;分类按 σ(z) 与阈值比较——σ(z)≥阈值判「正类」、否则「负类」;对数几率=ln[σ÷(1−σ)],与输入 z 恒等(logit 反变换复核项)。校验:无强校验,空值按 0 兜底。判据:阈值为 0.5 时概率过半即判正类,阈值上移则更保守(漏报增多、误报减少)。

将任意实数映射到 (0,1)。

📚 深度解析:Sigmoid 输出

💡 常见使用场景

概率映射
logit=2 → σ=1/(1+e⁻²)=0.881;logit=−2 → σ=0.119;logit=0 → 0.5。可见 logit 每增加 1,概率向 1 推进一步但减速(饱和)。

❓ 常见问题(FAQ)

Sigmoid 和 Softmax 区别?
Sigmoid 独立处理每个 logit、输出各维独立概率(可不和为1),适合多标签;Softmax 归一化使各类概率和为1,适合单标签多分类。
为什么 Sigmoid 易饱和导致梯度消失?
当 |x| 很大时 σ 接近 0 或 1,导数≈0,反向传播梯度趋零;深层网络常用 BatchNorm 与 ReLU 缓解,或用 Swish 等替代。

Formula & Standard References

Item Formula / Note Source / Standard
Function definition sigmoid is one over one plus e to the minus x mapping to the open unit interval Bishop, Pattern Recognition and Machine Learning
Derivative the derivative equals the output times one minus the output Bishop, Pattern Recognition and Machine Learning
Binary threshold the default cut-off is one half which corresponds to a zero logit boundary ISO/IEC 22989:2022 AI concepts