Skip to content
class

SoftplusTransform

extendsTransform
SoftplusTransform()

Element-wise softplus bijection y=log⁡(1+ex)y = \log(1 + e^x).

Maps R→(0,∞)\mathbb{R} \to (0, \infty) element-wise with linear growth for large positive inputs, making it more numerically stable than ExpTransform. Monotone increasing, bijective, event_dim = 0.

Notes

Forward: y=softplus⁡(x)=log⁡(1+ex)y = \operatorname{softplus}(x) = \log(1 + e^x).

Inverse: x=log⁡(ey−1)=y+log⁡(1−e−y)x = \log(e^y - 1) = y + \log(1 - e^{-y}).

Log Jacobian determinant:

log⁡ ⁣∣∂y∂x∣=log⁡σ(x)=−softplus⁡(−x)\log\!\left|\frac{\partial y}{\partial x}\right| = \log \sigma(x) = -\operatorname{softplus}(-x)

Used by 2

Instance methods

1
fn

log_abs_det_jacobian

→Tensor
log_abs_det_jacobian(x: Tensor, y: Tensor)

Log-Jacobian −softplus⁡(−x)-\operatorname{softplus}(-x).