mindspore.mint.nn.LogSigmoid
- class mindspore.mint.nn.LogSigmoid[source]
Applies logsigmoid activation element-wise. The input is a Tensor with any valid shape.
Logsigmoid is defined as:
\[\text{logsigmoid}(x_{i}) = \log(\frac{1}{1 + \exp(-x_i)}),\]where \(x_{i}\) is the element of the input.
LogSigmoid Activation Function Graph:
Warning
This is an experimental API that is subject to change or deletion.
- Inputs:
input (Tensor) - The input of LogSigmoid with data type of bfloat16, float16 or float32. The shape is \((*)\) where \(*\) means, any number of additional dimensions.
- Outputs:
Tensor, with the same type and shape as the input.
- Raises
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> from mindspore import Tensor >>> net = mint.nn.LogSigmoid() >>> input = Tensor([1.0, 2.0, 3.0], mindspore.float32) >>> output = net(input) >>> print(output) [-0.31326166 -0.12692806 -0.04858734]