Spec-Zone.ru › TensorFlow 1.15

tf.keras.activations.tanh

Просмотреть исходный код на GitHub

Функция активации гиперболического тангенса (tanh).

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

Псевдонимы для миграции

См. Руководство по миграции для получения дополнительной информации.

tf.compat.v1.keras.activations.tanh, `tf.compat.v2.keras.activations.tanh`

tf.keras.activations.tanh(
    x
)

Например:

# Constant 1-D tensor populated with value list.
a = tf.constant([-3.0,-1.0, 0.0,1.0,3.0], dtype = tf.float32)
b = tf.keras.activations.tanh(a) #[-0.9950547,-0.7615942,
0.,0.7615942,0.9950547]

Аргументы: x: Входной тензор.

Возвращает
Тензор с той же формой и типом данных, что и вход x. Активация tanh: tanh(x) = sinh(x)/cosh(x) = ((exp(x) - exp(-x))/(exp(x) + exp(-x))).

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/activations/tanh

Spec-Zone.ru

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