fn
softsign
→Tensorsoftsign(x: Tensor)Softsign activation.
A bounded activation that saturates polynomially
rather than exponentially — its tails are much heavier than
tanh's, so gradients vanish more slowly in deep networks.
Parameters
xTensorInput tensor of any shape; activation is element-wise.
Returns
TensorActivated tensor with the same shape as x, values in
.
Notes
Derivative decays like rather than 's , so saturation is gentler. Lacks the bi-Lipschitz smoothness of tanh near zero (kink at from the absolute value) but is monotone and zero-centred.
Examples
>>> import lucid
>>> from lucid.nn.functional import softsign
>>> x = lucid.tensor([-2.0, -1.0, 0.0, 1.0, 2.0])
>>> softsign(x)
Tensor([-0.6667, -0.5000, 0.0000, 0.5000, 0.6667])