Skip to Content
  • Kickstarters

  • Deep Dive
Edit this page

Sigmoid Activation

The sigmoid activation function, also known as the logistic function, is a widely used activation function in artificial neural networks (ANNs). It is a smooth, differentiable function that maps input values to the range (0, 1), making it particularly useful for binary classification tasks and for representing probabilities in a neural network.

Definition

The sigmoid activation function is defined as:

σ(x)=11+ex \sigma(x) = \frac{1}{1 + e^{-x}}

where xx is the input value and ee is the base of the natural logarithm. The function takes any real-valued input and maps it to a value between 0 and 1. The sigmoid function is symmetric around the vertical axis at x=0x = 0, with the function approaching 0 as xx approaches negative infinity and approaching 1 as xx approaches positive infinity.

Properties

The sigmoid activation function has several properties that make it useful for neural networks:

  1. Smoothness: The sigmoid function is smooth and differentiable everywhere, which is important for gradient-based optimization algorithms such as backpropagation.

  2. Monotonicity: The sigmoid function is monotonically increasing, meaning that its output increases as its input increases. This property ensures that the function is well-behaved and can be used to represent an ordering of input values.

  3. Saturating: The sigmoid function saturates at its extremes, meaning that its output approaches 0 or 1 as the input becomes very large or very small. This property can be both an advantage and a disadvantage. On one hand, it can help to stabilize the output of a neural network, but on the other hand, it can lead to the vanishing gradient problem, where the gradients of the function become very small and slow down learning.

  4. Centered around 0.5: The sigmoid function is centered around 0.5, which can be useful for representing probabilities or for binary classification tasks where the output should be interpreted as the probability of belonging to one of two classes.

Derivative

The derivative of the sigmoid function is important for backpropagation and gradient-based optimization algorithms. The derivative can be expressed in terms of the sigmoid function itself:

dσ(x)dx=σ(x)(1σ(x)) \frac{d\sigma(x)}{dx} = \sigma(x)(1 - \sigma(x))

This expression is convenient for computation, as it allows for efficient calculation of the gradient during backpropagation.

Applications

The sigmoid activation function is commonly used in ANNs for binary classification tasks, where the output of the network should represent the probability of an input belonging to one of two classes. It is also used in the output layer of multi-layer perceptrons (MLPs) for multi-class classification tasks, in combination with the softmax function, which normalizes the output probabilities to sum to 1.

Limitations and Alternatives

While the sigmoid activation function has been widely used in neural networks, it has some limitations that have led to the development of alternative activation functions. One major limitation is the vanishing gradient problem, which occurs when the gradients of the function become very small for large input values. This can slow down learning and make it difficult for the network to converge to a good solution.

Alternative activation functions, such as the rectified linear unit (ReLU) and the hyperbolic tangent (tanh) function, have been developed to address some of the limitations of the sigmoid function. The ReLU function is defined as f(x)=max(0,x)f(x) = max(0, x) and is non-linear, non-differentiable at 0, and does not suffer from the vanishing gradient problem. The tanh function is defined as f(x)=exexex+exf(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}} and is similar to the sigmoid function but maps input values to the range (-1, 1), making it more suitable for tasks where the output should be centered around 0.

  • Contents

  • Definition

  • Properties

  • Derivative

  • Applications

  • Limitations and Alternatives


Last updated: Loading...