sklvq.activations.Identity

class sklvq.activations.Identity[source]

Identity function

Class that holds the identity function and gradient.

See also

Sigmoid, SoftPlus, Swish
__call__(x: numpy.ndarray)numpy.ndarray[source]
Implementation of the identity function:

f(\mathbf{x}) = \mathbf{x}

Parameters
xndarray of any shape
Returns
xndarray

Elementwise evaluation of the identity function.

gradient(x: numpy.ndarray)numpy.ndarray[source]
The identity functions’s gradient:

\frac{\partial f}{\partial \mathbf{x}} = \mathbf{1}

Parameters
xndarray
Returns
ndarray of shape (x.shape)

Elementwise evaluation of the identity function’s gradient.