tf.keras.ops.elu
Функция активации Экспоненциально линейного блока.
tf.keras.ops.elu(
x, alpha=1.0
)
Определяется как:
f(x) = alpha * (exp(x) - 1.) for x < 0, f(x) = x for x >= 0.
| Аргументы | |
|---|---|
x | Входной тензор. |
alpha | Скаляр, наклон положительной части. По умолчанию 1.0. |
| Возвращает | |
|---|---|
Тензор с такой же формой, что и x. |
Пример:
x = np.array([-1., 0., 1.]) x_elu = keras.ops.elu(x) print(x_elu) array([-0.63212055, 0., 1.], shape=(3,), dtype=float64)
© 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/elu