Sigmoid Calculator
Calculate the logistic sigmoid function for any finite real number. Enter one value or a list of values to find their sigmoid outputs and derivatives. This calculator is useful for studying activation functions, logistic regression, neural networks, and probability models.
Calculate the Sigmoid Function
Enter one or more numerical values separated by commas, spaces, semicolons, or new lines.
What Is the Sigmoid Function?
The sigmoid function, also called the logistic function, is a mathematical function that maps a real-valued input to an output between zero and one. Its characteristic S-shaped curve makes it useful for representing values as probabilities or activation levels.
Sigmoid Formula
Where:
- x is the input value.
- e is Euler's number, approximately 2.71828.
- e-x is the exponential of negative x.
- σ(x) is the resulting sigmoid value.
Important Sigmoid Values
| x | Sigmoid σ(x) |
|---|---|
| -5 | 0.006693 |
| -2 | 0.119203 |
| -1 | 0.268941 |
| 0 | 0.500000 |
| 1 | 0.731059 |
| 2 | 0.880797 |
| 5 | 0.993307 |
Properties of the Logistic Sigmoid
- Domain: All real numbers, from negative infinity to positive infinity.
- Range: Strictly between 0 and 1 for finite inputs.
- Midpoint: σ(0) = 0.5.
- Monotonicity: The function is strictly increasing.
- Symmetry: σ(-x) = 1 - σ(x).
- Horizontal asymptotes: The output approaches 0 as x approaches negative infinity and 1 as x approaches positive infinity.
- Inflection point: The curve changes concavity at x = 0.
Derivative of the Sigmoid Function
The derivative describes how quickly the sigmoid output changes as the input changes. A useful property of the logistic sigmoid is that its derivative can be calculated directly from its output.
Maximum Derivative
The derivative reaches its maximum value at x = 0, where the sigmoid output is 0.5.
The derivative approaches zero for very large positive or negative inputs. This behavior is associated with the vanishing gradient problem in neural networks.
Worked Example
Calculate the sigmoid of x = 2.
Step 1: Write the formula
Step 2: Substitute x = 2
Step 3: Calculate the exponential
Step 4: Calculate the result
σ(2) ≈ 0.880797
The sigmoid output for x = 2 is approximately 0.880797, or 88.0797%.
Applications of the Sigmoid Function
- Logistic regression: Converts a linear model output into a probability estimate for binary classification.
- Neural networks: Used as an activation function in some network architectures.
- Binary classification: Produces scores that can be compared with a decision threshold.
- Probability modeling: Maps unrestricted real-valued scores into the interval between zero and one.
- Statistics: Appears in logistic models and other probability-related calculations.
Sigmoid vs. Softmax
Sigmoid and softmax are both used to produce values between zero and one, but they serve different purposes.
| Feature | Sigmoid | Softmax |
|---|---|---|
| Input | One value at a time | A vector of values |
| Output | Between 0 and 1 | Probabilities between 0 and 1 |
| Sum of outputs | Not necessarily 1 | 1 |
| Common use | Binary classification | Multiclass classification |
Frequently Asked Questions
1. What is the sigmoid function?
The sigmoid function is a mathematical function that maps any finite real input to a value strictly between zero and one. The logistic sigmoid is defined as 1 / (1 + e-x).
2. What is the sigmoid of zero?
The sigmoid of zero is exactly 0.5. This is the midpoint of the logistic sigmoid curve.
3. What is the derivative of the sigmoid function?
The derivative is σ(x) multiplied by one minus σ(x): σ'(x) = σ(x)(1 - σ(x)).
4. What is the range of the sigmoid function?
For every finite real input, the logistic sigmoid output is strictly greater than zero and strictly less than one. It approaches zero and one asymptotically.
5. Can the sigmoid function handle negative numbers?
Yes. Negative inputs are valid. As the input becomes more negative, the sigmoid output approaches zero.
6. Where is the sigmoid function used?
It is used in logistic regression, binary classification, probability modeling, and some neural network architectures.
7. Why is the sigmoid function called an S-curve?
Its graph has a characteristic S shape: it increases slowly for very negative inputs, rises most rapidly near zero, and levels off for very positive inputs.
8. What is the maximum derivative of sigmoid?
The maximum derivative is 0.25, occurring at x = 0. The derivative becomes smaller as the input moves away from zero.
9. Is sigmoid the same as softmax?
No. Sigmoid maps individual inputs independently, while softmax normalizes a group of scores so their probabilities sum to one.