tf.keras.ops.silu
Функция активации SiLU (Сигмоидально-линейная единица), также известная как Swish.
tf.keras.ops.silu(
x
)
Функция активации SiLU вычисляется как произведение сигмоидальной функции и её входного значения. Она определяется как f(x) = x * sigmoid(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) keras.ops.silu(x) array([-0.0148357, 0.7310586, 0.0, 0.7310586, 5.9851646], 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/silu