CamDavidsonPilon / autograd-gamma

NotImplementedError: VJP of gammainc wrt argnum 0 not defined
MIT License
15 stars 4 forks source link

Handle large values of x #1

Closed erikbern closed 5 years ago

erikbern commented 5 years ago

I tried using this with convoys, but the optimization would crash because of nan values. The problem is computing the derivative wrt x, where there's a fraction where both the numerator and denominator are inf so that the fraction is computed as nan.

Doing the computation in the log-domain instead resolves the issue.

CamDavidsonPilon commented 5 years ago

Yay to common libraries!

Nice addition, thanks @erikbern

CamDavidsonPilon commented 5 years ago

I pushed the latest to PyPI too: https://pypi.org/project/autograd-gamma/