tf.math.sigmoid(tf.sigmoid)

介绍

计算 sigmoid

关于sigmoid,详见:
https://www.malaoshi.top/show_1EF4IWSucFTE.html

常用别名

  • tf.sigmoid
  • tf.nn.sigmoid

语法

tf.math.sigmoid(
    x,
    name=None
)
参数
  • x:tensor,必须是下面类型之一:float16, float32, float64, complex64, or complex128

例子

import tensorflow as tf

a = tf.constant([[-1.0, 1.0], [-20, 20]])
b=tf.sigmoid(a)
print(b)

执行结果:

tf.Tensor(
[[0.26894143 0.7310586 ]
 [0.         1.        ]], shape=(2, 2), dtype=float32)

原文出处:/show_1EF5DLAuBptO.html