xnn.common.models.ops.shifted_softplus#

xnn.common.models.ops.shifted_softplus(x)[source]#

Shifted softplus ssp(x) = ln(0.5 e^x + 0.5) with ssp(0) = 0.

The activation of SchNet (Schuett et al., NIPS 2017) and PhysNet (Unke & Meuwly 2019); smooth with infinite order of continuity, which is what keeps the predicted potential-energy surface (and thus the autograd forces) smooth.

Evaluated with exact_softplus() minus ln 2, exact to round-off for all x in float32 and float64. TorchScript-compatible.

Parameters:

x (torch.Tensor) – Input tensor of any shape.

Returns:

ln(0.5 e^x + 0.5), same shape as x.

Return type:

torch.Tensor