Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exp Overflow Warning #123

Open
sjenkins20 opened this issue Sep 5, 2024 · 0 comments
Open

Exp Overflow Warning #123

sjenkins20 opened this issue Sep 5, 2024 · 0 comments

Comments

@sjenkins20
Copy link

sjenkins20 commented Sep 5, 2024

Following an upgrade to use Python 3.11 and numpy 2.0.0, we've been getting some odd results from the influenza like illness model. Other associated packages were upgraded too and a list can be provided. We believe in one of these packages, warning supression has been changed and as a result, we are now receiving warnings we previously weren't and the effects of the issues are now being observed.

In this instance, we are seeing large spikes in the population outputs. The associated warning when this occurs is an overflow warning for exp. We have narrowed this down to the calculation of expressions of the form 1/(exp(x)+1), where the value of x is becoming larger than exp can handle. In this instance, expit is a good solution https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.expit.html

However, the solution requires that _model_verification.py be updated to allow the model Transitions, defined as strings, to interpret expit and utilise it. This requires that expit be passed the inputs as an array and we are unsure how to formulate this in a Transition string, or if this needs adding to the implementation. We have a temporary solution in place, but I think others would benefit from the use of expit too.

There are also other models in pygom that use this formulation, but we are not seeing the issue there currently, but it would be good to use expit here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant