scipy.maxentropy.logsumexp

scipy.maxentropy.logsumexp(a)

Compute the log of the sum of exponentials of input elements.

Parameters :

a : array_like

Input array.

Returns :

res : ndarray

The result, np.log(np.sum(np.exp(a))) calculated in a numerically more stable way.

Notes

Numpy has a logaddexp function which is very similar to logsumexp.

Previous topic

scipy.maxentropy.innerprodtranspose

This Page