tf.keras.ops.softsign
Функция активации softsign.
tf.keras.ops.softsign(
x
)
Она определяется как f(x) = x / (abs(x) + 1).
| Аргументы | |
|---|---|
x | Входной тензор. |
| Возвращаемое значение | |
|---|---|
Тензор с теми же размерами, что и x. |
Пример:
x = keras.ops.convert_to_tensor([-0.100, -10.0, 1.0, 0.0, 100.0]) keras.ops.softsign(x) Array([-0.09090909, -0.90909094, 0.5, 0.0, 0.990099], 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/softsign