<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/nn.py#L96-L117) |

Sigmoid activation function.

#### View aliases


**Main aliases**

[`tf.keras.ops.nn.sigmoid`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/sigmoid)

<br />

    tf.keras.ops.sigmoid(
        x
    )

It is defined as `f(x) = 1 / (1 + exp(-x))`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor with the same shape as `x`. ||

<br />

#### Example:

    x = keras.ops.convert_to_tensor([-6.0, 1.0, 0.0, 1.0, 6.0])
    keras.ops.sigmoid(x)
    array([0.00247262, 0.7310586, 0.5, 0.7310586, 0.9975274], dtype=float32)