when I used hmc sampling, there is OverflowError: math range error. However, when I used metropolis sampling,there is no error.
why?
step=pm.HamiltonianMC()
Yeah that’s a bug.
should replace math.exp
with np.exp
. Do you want to send a PR to fix this?
en, I hadn’t use max.exp
.
Oh, I see. PR, pull requests.
PR means pull request - if you found a bug in the code, and you know how to fix it, you can send a pull request on Github, there is more information here:
# Guidelines for Contributing
As a scientific community-driven software project, PyMC3 welcomes contributions from interested individuals or groups. These guidelines are provided to give potential contributors information to make their contribution compliant with the conventions of the PyMC3 project, and maximize the probability of such contributions to be merged as quickly and efficiently as possible.
There are 4 main ways of contributing to the PyMC3 project (in descending order of difficulty or scope):
* Adding new or improved functionality to the existing codebase
* Fixing outstanding issues (bugs) with the existing codebase. They range from low-level software bugs to higher-level design problems.
* Contributing or improving the documentation (`docs`) or examples (`pymc3/examples`)
* Submitting issues related to bugs or desired enhancements
# Opening issues
We appreciate being notified of problems with the existing PyMC code. We prefer that issues be filed the on [Gitub Issue Tracker](https://github.com/pymc-devs/pymc3/issues), rather than on social media or by direct email to the developers.
Please verify that your issue is not being currently addressed by other issues or pull requests by using the GitHub search tool to look for key words in the project issue tracker.
# Contributing code via pull requests
While issue reporting is valuable, we strongly encourage users who are inclined to do so to submit patches for new or existing issues via pull requests. This is particularly the case for simple fixes, such as typos or tweaks to documentation, which do not require a heavy investment of time and attention.
This file has been truncated. show original
The error you are seeing is a bug in PyMC3, where hmc
uses math.exp
to compute the exponential and math.exp
gives an error if the input is too large. Replacing math.exp
with np.exp
would fix this.
Oh, I see. Thanks! I will have a try.
1 Like