Computes sigmoid of `x` element-wise. Specifically, `y = 1 / (1 + exp(-x))`. Args: x: A Tensor with type `float16`, `float32`, `float64`, `complex64`, or `complex128`. name: A name for the operation (optional). Returns: A Tensor with the same type as `x`. @compatibility
(x, name=None)
| 3100 | |
| 3101 | @tf_export("math.sigmoid", "nn.sigmoid", "sigmoid") |
| 3102 | def sigmoid(x, name=None): |
| 3103 | """Computes sigmoid of `x` element-wise. |
| 3104 | |
| 3105 | Specifically, `y = 1 / (1 + exp(-x))`. |
| 3106 | |
| 3107 | Args: |
| 3108 | x: A Tensor with type `float16`, `float32`, `float64`, `complex64`, or |
| 3109 | `complex128`. |
| 3110 | name: A name for the operation (optional). |
| 3111 | |
| 3112 | Returns: |
| 3113 | A Tensor with the same type as `x`. |
| 3114 | |
| 3115 | @compatibility(scipy) |
| 3116 | Equivalent to scipy.special.expit |
| 3117 | @end_compatibility |
| 3118 | """ |
| 3119 | with ops.name_scope(name, "Sigmoid", [x]) as name: |
| 3120 | x = ops.convert_to_tensor(x, name="x") |
| 3121 | return gen_math_ops.sigmoid(x, name=name) |
| 3122 | |
| 3123 | |
| 3124 | @tf_export("math.log_sigmoid", v1=["math.log_sigmoid", "log_sigmoid"]) |
no test coverage detected