Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

LogSigmoid#

class torch.nn.modules.activation.LogSigmoid(*args, **kwargs)[source]#

Applies the Logsigmoid function element-wise.

LogSigmoid(x)=logโก(11+expโก(โˆ’x))\text{LogSigmoid}(x) = \log\left(\frac{ 1 }{ 1 + \exp(-x)}\right)
Shape:
  • Input: (โˆ—)(*), where โˆ—* means any number of dimensions.

  • Output: (โˆ—)(*), same shape as the input.

../_images/LogSigmoid.png

Examples:

>>> m = nn.LogSigmoid()
>>> input = torch.randn(2)
>>> output = m(input)
forward(input)[source]#

Run forward pass.

Return type

Tensor