ncdl.nn.Sigmoid

class ncdl.nn.Sigmoid(*args: Any, **kwargs: Any)

Applies the element-wise function:

\[\text{Sigmoid}(x) = \sigma(x) = \frac{1}{1 + \exp(-x)}\]
Shape:
  • Input: \((*)\), where \(*\) means any number of dimensions.

  • Output: \((*)\), same shape as the input.

scripts/activation_images/Sigmoid.png

Examples:

>>> m = nn.Sigmoid()
>>> input = torch.randn(2)
>>> output = m(input)
__init__(*args: Any, **kwargs: Any) None

Methods

__init__(*args, **kwargs)

forward(input)