# tf.keras.backend.relu

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/backend/relu) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/keras/backend.py#L4313-L4363) |

Rectified linear unit.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.backend.relu`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/relu)

<br />

    tf.keras.backend.relu(
        x, alpha=0.0, max_value=None, threshold=0
    )

With default values, it returns element-wise `max(x, 0)`.

Otherwise, it follows:
`f(x) = max_value` for `x >= max_value`,
`f(x) = x` for `threshold <= x < max_value`,
`f(x) = alpha * (x - threshold)` otherwise.

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `x` | A tensor or variable. |
| `alpha` | A scalar, slope of negative section (default=`0.`). |
| `max_value` | float. Saturation threshold. |
| `threshold` | float. Threshold value for thresholded activation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor. ||

<br />