logsumexp
Logsumexp is a mathematical function used to compute the logarithm of a sum of exponentials in a numerically stable way. For a vector x = (x1, ..., xn), it is defined as logsumexp(x) = log(sum_i exp(x_i)). This quantity often appears in log-domain probability calculations, such as log-likelihoods, log-partition functions, and other scenarios involving log-sum-exp terms.
Directly computing exp(x_i) can lead to overflow or underflow, so a common stable form is to subtract
The derivative with respect to x_j is exp(x_j)/sum_i exp(x_i) = softmax_j(x). This creates a close relationship to
Extensions and implementations include applying logsumexp along a specified axis for matrices or tensors, yielding a
Applications of logsumexp span machine learning and statistics, including computing log-likelihoods in probabilistic models, evaluating partition