Use Cases of scipy. misc. logsumexp function in python, scipy. misc

Source: Internet
Author: User

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 ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.