Skip to content

← Activations step 2 of 9

Easy Primitives

Implement Sigmoid

Implement the sigmoid activation function.

$$\sigma(x) = \frac{1}{1 + e^{-x}}$$

The sigmoid function maps any real number to the range $(0, 1)$.

Input: A tensor x of any shape

Output: A tensor of the same shape with values in $(0, 1)$

Loading visualization…