tf.keras.backend.relu
Stay organized with collections
Save and categorize content based on your preferences.
Rectified linear unit.
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.
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.relu\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/keras/backend/relu) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L4209-L4259) |\n\nRectified linear unit.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.relu`](/api_docs/python/tf/keras/backend/relu), \\`tf.compat.v2.keras.backend.relu\\`\n\n\u003cbr /\u003e\n\n tf.keras.backend.relu(\n x, alpha=0.0, max_value=None, threshold=0\n )\n\nWith default values, it returns element-wise `max(x, 0)`.\n\nOtherwise, it follows:\n`f(x) = max_value` for `x \u003e= max_value`,\n`f(x) = x` for `threshold \u003c= x \u003c max_value`,\n`f(x) = alpha * (x - threshold)` otherwise.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-------------|-----------------------------------------------------|\n| `x` | A tensor or variable. |\n| `alpha` | A scalar, slope of negative section (default=`0.`). |\n| `max_value` | float. Saturation threshold. |\n| `threshold` | float. Threshold value for thresholded activation. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor. ||\n\n\u003cbr /\u003e"]]