chainer.functions.sigmoid

chainer.functions.sigmoid(x)[source]

Element-wise sigmoid logistic function.

\[f(x)=(1 + \exp(-x))^{-1}.\]
Parameters:x (Variable or numpy.ndarray or cupy.ndarray) – Input variable. A \((s_1, s_2, ..., s_N)\)-shaped float array.
Returns:Output variable. A \((s_1, s_2, ..., s_N)\)-shaped float array.
Return type:Variable

Example

It maps the input values into the range of \([0, 1]\).

>>> x = np.arange(-2, 3, 2).astype(np.float32)
>>> x
array([-2.,  0.,  2.], dtype=float32)
>>> F.sigmoid(x).array
array([0.11920291, 0.5       , 0.8807971 ], dtype=float32)