The following small series will introduce the application scenarios of scipy. misc. logsumexp functions in python. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at 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 support the scripts ~