mindspore.ops.logsigmoid

mindspore.ops.logsigmoid(x)[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
Parameters

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

Returns

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

Raises

TypeError – If dtype of x is neither float16 nor float32.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([1.0, 2.0, 3.0]), mindspore.float32)
>>> output = ops.logsigmoid(x)
>>> print(output)
[-0.31326166 -0.12692806 -0.04858734]