How to use this calculator
Normalize unscaled likelihoods stored in log form without overflowing the exponential function.
- Enter Log weights. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Stable log sum exponential normalization explained
This guide follows stable log sum exponential normalization calculator from its stated formula through a worked example, then identifies the assumptions that bound the result.
Inputs, symbols, and units
scores— Log weights- Finite natural-log weights; absolute offsets may be large. Use comma-separated values in the stated order.
Formula and method
L=m+ln Σexp(aᵢ−m), m=max aᵢ; pᵢ=exp(aᵢ−L); H=−Σpᵢ ln pᵢ.
All logarithms are natural. Subtracting the largest log weight preserves relative weights while avoiding exp(1000)-type overflow; it does not change the normalized distribution.
A worked scenario
Log weights = [1000, 1001, 999].
- Log sum exp: 1001.407606 natural log
- Largest normalized weight: 0.665241
- Entropy: 0.832396 nats
Log weights 1000, 1001 and 999 have a finite log-sum of approximately 1001.407606 despite their direct exponentials overflowing ordinary double precision.
Assumptions and edge cases
This is numerical normalization, not a calibrated classifier or a statistical likelihood model. Extremely small normalized weights may underflow to zero.
Reading the outputs
Log-sum retains the shared log scale; largest normalized weight lies between zero and one. Entropy is in nats and describes the full normalized set.
Frequently asked questions
Can all log weights be negative?
Yes. A common offset cancels from the normalized weights.
Are these base-10 logarithms?
No. Convert base-10 log weights by multiplying them by ln(10) first.
Why show entropy?
It indicates whether normalized weight is concentrated in one entry or spread across the list.
How do I use the Stable log sum exponential normalization calculator?
Enter Log weights. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Stable log sum exponential normalization?
Log weights = [1000, 1001, 999]. Log sum exp: 1001.407606 natural log Largest normalized weight: 0.665241 Entropy: 0.832396 nats Log weights 1000, 1001 and 999 have a finite log-sum of approximately 1001.407606 despite their direct exponentials overflowing ordinary double precision.
Background or definition reference: NIST DLMF numerical methods.
Read our calculation methodology.