Use Cases of scipy. misc. logsumexp function in python, scipy. misc
Scipy. misc. the input parameters of the logsumexp function are (a, axis = None, B = None, keepdims = False, return_sign = False). For specific configuration, see here. The returned value is np. log (np. sum (np. exp ())).
Here we need to emphasize the use of this function:
In general, this function is mainly used for computation of very small values (such as monte carlo sampling samples ). In this case, it is necessary to maintain log processing. So if you want to accumulate the sum of the data in the array, You need to calculate log (sum (exp (a) in this way, but this will produce some accuracy problems, and this
The problem scipy. misc. logsumexp is solved by introduction. Therefore, you can directly use the scipy. misc. logsumexp function for small data summation.
Reference: https://github.com/numpy/numpy/issues/5652
The above is a brief introduction to the use cases of scipy. misc. logsumexp functions in python. I hope you can provide more support ~