keisoku

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

165.90%224.24%39.86%

Per-component details

ComponentInput zProbabilityPercent
120.659065.90%
210.242424.24%
30.10.09869.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

  1. Home
  2. Softmax Function Calculator