Softmax Function Calculator
Enter a numeric vector to compute the softmax probability of each component (summing to 1) and the component with the highest probability.
Input
Enter a numeric vector separated by commas, newlines, or spaces. The softmax probability of each component (summing to 1) is computed.
Example: 2, 1, 0.1 (comma, newline, or space separated)
Result
Highest probability is component 1
65.90%
Components
3
Sum of probabilities
1.0000
Probability distribution
Per-component details
| Component | Input z | Probability | Percent |
|---|---|---|---|
| 1 | 2 | 0.6590 | 65.90% |
| 2 | 1 | 0.2424 | 24.24% |
| 3 | 0.1 | 0.0986 | 9.86% |
How it works
- The softmax function turns a real vector z=(z1, …, zn) into a probability vector that sums to 1. Its i-th component is softmax_i = e^(zi) / sum over j of e^(zj).
- Every output is greater than 0 and at most 1, and all components add up to exactly 1. This lets you read each value as the probability of belonging to that class in multiclass classification.
- This tool uses the numerically stable formulation. To avoid overflow in the exponential, it subtracts the maximum input value from every component before computing e to the power. Subtracting the maximum does not change the mathematical result.
- Shifting all inputs by a constant c leaves the output unchanged (shift invariance). Scaling all inputs by a constant changes the sharpness of the peak: larger scaling concentrates more probability on the largest component.
- In machine learning, softmax is the activation in the final layer of a neural network that converts logits (scores) into probabilities, typically trained with the cross-entropy loss. For two components it reduces to the sigmoid function.
- Enter multiple numbers separated by commas, newlines, or spaces. There is no limit on the number of components, and a table and bar chart show the probability of each one.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
Softmax Function Calculator