keisoku

Sigmoid Function Calculator

Enter x to compute the sigmoid σ(x)=1/(1+e^(-x)) with its first and second derivatives, plus a curve chart.

Input

Enter x to compute the sigmoid function σ(x)=1/(1+e^(-x)) together with its first and second derivatives.

Any real number is allowed.

Result

Value of σ(0)

0.5

First derivative σ'(0)

0.25

Second derivative σ'(0)

0

Input x

0

Sigmoid curve

How it works

  • The sigmoid (logistic) function is defined as σ(x)=1/(1+e^(-x)) and smoothly maps any real number x into the open interval from 0 to 1. It passes through σ(0)=0.5 and forms an S-shaped curve that approaches 1 for large x and 0 for small x.
  • Its first derivative has the compact form σ'(x)=σ(x)(1-σ(x)) and reaches its maximum value of 0.25 at x=0. Because the derivative is expressed through the output itself, gradients are cheap to compute.
  • The second derivative is σ''(x)=σ'(x)(1-2σ(x)); it changes sign at x=0, marking the inflection point of the curve.
  • In machine learning the sigmoid is used as a neural network activation function and as the probability output of logistic regression for binary classification, since its output can be read as a probability.
  • For inputs with large magnitude the derivative is nearly 0, which leads to the vanishing-gradient problem that limits the sigmoid in deep networks.
  • To stay numerically stable, this calculator switches the formula based on the sign of x so that e^(-x) never overflows.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Sigmoid Function Calculator