Functions and operators

softplus⁡(x)=log⁡(1+ex)\operatorname{softplus}(x) = \log(1 + e^{x}) Softplus

log(1 + eˣ): a smooth ReLU whose output is always positive.

In ML papers

softplus⁡(x)=log⁡(1+ex)\operatorname{softplus}(x) = \log(1 + e^x) is a smooth version of ReLU: close to 0 for very negative xx, close to xx for large xx, and always strictly positive. Its derivative is the sigmoid σ(x)\sigma(x).

Its main use is to make an output positive: a network predicts any real number and softplus turns it into a standard deviation, a variance, a rate or a step size. It also appears inside losses: −log⁡σ(x)=softplus⁡(−x)-\log \sigma(x) = \operatorname{softplus}(-x), so the logistic loss is a softplus.

How to type it

LaTeXShows
\operatorname{softplus}(x)softplus⁡(x)\operatorname{softplus}(x)
\log(1 + e^{x}) written outlog⁡(1+ex)\log(1 + e^{x})

A worked example

softplus⁡(0)=log⁡2≈0.693,softplus⁡(2)≈2.127\operatorname{softplus}(0) = \log 2 \approx 0.693, \quad \operatorname{softplus}(2) \approx 2.127

At −5-5 it is about 0.00670.0067: small, but never zero.

Common confusions

Related

ReLU⁡(x)=max⁡(0,x)\operatorname{ReLU}(x) = \max(0, x)ReLUσ(z)\sigma(z)Sigma (lowercase)log⁡pθ(x)\log p_\theta(x)Logarithm

Decode this example →