sklvq.activations.SoftPlus

class sklvq.activations.SoftPlus(beta: Union[int, float] = 1)[source]

Soft+ function

Class that holds the soft+ function and gradient as discussed in [1]

Parameters
betaint or float, optional, default=1

Positive non-zero value that controls the steepness of the Soft+ function.

See also

Identity, Sigmoid, Swish

References

[1] Villmann, T., Ravichandran, J., Villmann, A., Nebel, D., & Kaden, M. (2019). “Activation Functions for Generalized Learning Vector Quantization - A Performance Comparison”, 2019.

__call__(x: numpy.ndarray)numpy.ndarray[source]
Implements the soft+ function:

f(\mathbf{x}) = \ln(1 + e^{\beta \cdot \mathbf{x}})

Parameters
xndarray of any shape
Returns
ndarray of shape (x.shape)

Elementwise evaluation of the soft+ function.

gradient(x: numpy.ndarray)numpy.ndarray[source]
Implements the sigmoid function’s gradient:

\frac{\partial f}{\partial \mathbf{x}} = \frac{\beta \cdot e^{\beta \cdot \mathbf{x}}}{1 + e^{\beta \cdot \mathbf{x}}}

Parameters
xndarray
Returns
ndarray of shape (x.shape)

Elementwise evaluation of the soft+ function’s gradient.