tf.keras.ops.sigmoid
Функция активации сигмоиды.
tf.keras.ops.sigmoid(
x
)
Она определяется как f(x) = 1 / (1 + exp(-x)).
| Аргументы | |
|---|---|
x | Входной тензор. |
| Возвращает | |
|---|---|
Тензор с той же формой, что и x. |
Пример:
x = keras.ops.convert_to_tensor([-6.0, 1.0, 0.0, 1.0, 6.0]) keras.ops.sigmoid(x) array([0.00247262, 0.7310586, 0.5, 0.7310586, 0.9975274], 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/sigmoid