Spec-Zone.ru › TensorFlow

tf.keras.ops.hard_sigmoid

Функция активации hard sigmoid.

Просмотр псевдонимов

Основные псевдонимы

tf.keras.ops.nn.hard_sigmoid

tf.keras.ops.hard_sigmoid(
    x
)

Определяется как:

0 if x < -2.5, 1 if x > 2.5, (0.2 * x) + 0.5 if -2.5 <= x <= 2.5.

Аргументы
x Входной тензор.
Возвращает
Тензор с теми же размерами, что и x.

Пример:

x = np.array([-1., 0., 1.])
x_hard_sigmoid = keras.ops.hard_sigmoid(x)
print(x_hard_sigmoid)
array([0.3, 0.5, 0.7], 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/hard_sigmoid

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API