Skip to main content

Module log_sigmoid

Module log_sigmoid 

Source
Expand description

Numerically-stable log-sigmoid (fp16-aware). Numerically-stable log-sigmoid: log σ(x) = −log(1 + e^−x).

The wider float formats evaluate log(1 / (1 + e^−x)) directly; the fp16 path uses the stable identity log σ(x) = −softplus(−x) (see softplus) to avoid overflow.

Functions§

log_sigmoid
Applies the log-sigmoid function element-wise: log(1 / (1 + e^−x)).