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

ValueError: array must not contain infs or NaNs #68

Open
tsryo opened this issue Nov 14, 2024 · 1 comment
Open

ValueError: array must not contain infs or NaNs #68

tsryo opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tsryo
Copy link

tsryo commented Nov 14, 2024

pis[i] /= resp_i.sum(axis=0)

Seems to happen for me intermittently, depending on what random state I start with. Happens when fitting a one-step model with full gaussian measurement model and binary_nan structural. When occurring it seems that a certain element in pis[i] (and its corresponding elemnt from resp_i ) , are equal to zero, causing 0/0 -> nan.
Current workaround I used was setting pis[i] with nan_to_num, where all nans are changed to zeroes.
Not sure if this is valid to do, or just treating the symptom instead of the root cause.

@sachaMorin sachaMorin added the bug Something isn't working label Nov 14, 2024
@sachaMorin
Copy link
Collaborator

Thanks for reporting this. Any chance you could share a dataset (e.g., via email) and a random_state to reproduce this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants