tf.keras.ops.relu6
Функция активации выпрямленного линейного блока с верхней границей 6.
tf.keras.ops.relu6(
x
)
Она определяется как f(x) = np.clip(x, 0, 6).
| Аргументы | |
|---|---|
x | Входной тензор. |
| Возвращает | |
|---|---|
Тензор с той же формой, что и x. |
Пример:
x = keras.ops.convert_to_tensor([-3.0, -2.0, 0.1, 0.2, 6.0, 8.0]) keras.ops.relu6(x) array([0.0, 0.0, 0.1, 0.2, 6.0, 6.0], dtype=float32)
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/ops/relu6