mindspore.mint.nn.functional.logsigmoid

mindspore.mint.nn.functional.logsigmoid(input)[source]

Applies logsigmoid activation element-wise. The input is a Tensor with any valid shape.

Logsigmoid is defined as:

logsigmoid(xi)=log(11+exp(xi)),

where xi is the element of the input.

LogSigmoid Activation Function Graph:

../../_images/LogSigmoid.png

Warning

This is an experimental API that is subject to change or deletion.

Parameters

input (Tensor) – The input of LogSigmoid with data type of bfloat16, float16 or float32. The shape is () where means, any number of additional dimensions.

Returns

Tensor, with the same type and shape as the input.

Raises
  • TypeError – If dtype of input is not bfloat16, float16 and float32.

  • TypeError – If input is not a Tensor.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> from mindspore import Tensor, mint
>>> input = Tensor([1.0, 2.0, 3.0], mindspore.float32)
>>> output = mint.nn.functional.logsigmoid(input)
>>> print(output)
[-0.31326166 -0.12692806 -0.04858734]