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)withssp(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()minusln 2, exact to round-off for allxin float32 and float64. TorchScript-compatible.- Parameters:
x (torch.Tensor) – Input tensor of any shape.
- Returns:
ln(0.5 e^x + 0.5), same shape asx.- Return type: