sparse_sigmoid#
- class brainstate.nn.sparse_sigmoid(x)[source]#
Sparse sigmoid activation function.
Computes the function:
\[\begin{split}\mathrm{sparse\_sigmoid}(x) = \begin{cases} 0, & x \leq -1\\ \frac{1}{2}(x+1), & -1 < x < 1 \\ 1, & 1 \leq x \end{cases}\end{split}\]This is the twin function of the standard sigmoid activation, ensuring a zero output for inputs less than -1, a 1 output for inputs greater than 1, and a linear output for inputs between -1 and 1. It is the derivative of sparse_plus.
- Parameters:
x (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Input array.- Returns:
An array with the same shape as the input.
- Return type:
Array|Quantity
See also
sigmoidStandard sigmoid activation function.
sparse_plusSparse plus activation function.
References