<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/activations/activations.py#L517-L537) |

Hard sigmoid activation function.

    tf.keras.activations.hard_sigmoid(
        x
    )

The hard sigmoid activation is defined as:

- `0` if `if x <= -3`
- `1` if `x >= 3`
- `(x/6) + 0.5` if `-3 < x < 3`

It's a faster, piecewise linear approximation
of the sigmoid activation.

<br />

<br />

<br />

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

<br />

#### Reference:

- [Wikipedia "Hard sigmoid"](https://en.wikipedia.org/wiki/Hard_sigmoid)