DL
    beginner

    Softmax Function

    algorithms.live

    Softmax Function Visualizer

    Watch how raw scores (logits) transform into probabilities step-by-step

    Loss: 0.6540

    Animation

    Initial StateStep 0/5

    Input Logits

    2.00
    1.00
    0.10
    0.50
    0.30

    Temperature

    1.00

    T < 1: Sharper | T = 1: Standard | T > 1: Softer

    Ground Truth

    Softmax: z → p1. Input Logits (z)Cat:z0 = 2.00Dog:z1 = 1.00Bird:z2 = 0.10Fish:z3 = 0.50Horse:z4 = 0.30e^z2. Exponentialse^(2.00) = 1.000e^(1.00) = 0.368e^(0.10) = 0.150e^(0.50) = 0.223e^(0.30) = 0.183Σ3. SumΣ = 1.923÷4. Probabilities52.0%19.1%7.8%11.6%9.5%Σp = 1.000000 ≈ 1.0 ✓Cross-Entropy Loss: L = -log(p_Cat) = 0.6540

    Initial State

    Ready to compute softmax!

    softmax(z) = e^zi / Σe^zj

    Current State

    Loss (Current)
    0.6540
    True Class Prob
    52.00%
    Temperature (T)
    1.00
    Σp (verify)
    1.000000

    Softmax Formula

    p_i = e^(z_i/T) / Σ_j e^(z_j/T)

    Converts logits to probabilities. All values in (0,1), sum to 1.0.

    Temperature Effect

    T < 1: Sharper | T = 1: Standard | T > 1: Softer

    Controls distribution confidence level.

    Cross-Entropy Loss

    L = -log(p_true)

    Lower loss = higher confidence in correct class.

    Mathematical Details

    Softmax Formula

    pi=ezi/T∑j=1Cezj/Tp_i = \frac{e^{z_i / T}}{\sum_{j=1}^{C} e^{z_j / T}}

    Where z_i are logits, T is temperature, C is number of classes.

    Cross-Entropy Loss

    L=−log⁡(ptrue)L = -\log(p_{\text{true}})

    Loss for true class: 0.6540

    Current Calculation (True Class: Cat)

    Exponentials: 1.000, 0.368, 0.150, 0.223, 0.183

    Sum (Σe^z): 1.923

    Probability: 1.000 / 1.923 = 0.5200

    Loss: -log(0.5200) = 0.6540

    Multi-Class Classification
    Activation Function
    Probability Distribution
    Cross-Entropy
    Fundamental

    Turn logits into probabilities

    Sequence

    Order a numerically stable softmax.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    5 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    The softmax function converts a vector of logits into…

    Learn these first

    Interview Questions

    Google
    NVIDIA
    Amazon
    OpenAI
    Cohere
    Anthropic
    LinkedIn
    Elastic
    Salesforce
    Google
    Meta
    Apple
    Google
    Microsoft
    Netflix

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required