View source on GitHub |
Sigmoid activation function.
tf.keras.ops.sigmoid(
x
)
It is defined as f(x) = 1 / (1 + exp(-x))
.
Args | |
---|---|
x
|
Input tensor. |
Returns | |
---|---|
A tensor with the same shape as x .
|
Example:
x = keras.ops.convert_to_tensor([-6.0, 1.0, 0.0, 1.0, 6.0])
keras.ops.sigmoid(x)
array([0.00247262, 0.7310586, 0.5, 0.7310586, 0.9975274], dtype=float32)