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

_do_forward_pass, _do_backward_pass, _compute_posteriors not defined in skweak.aggregation #38

Closed
ManuBohra opened this issue Feb 15, 2022 · 10 comments

Comments

@ManuBohra
Copy link

skweak/aggregation.py", line 405, in fit
logprob, fwdlattice = self._do_forward_pass(framelogprob)
AttributeError: 'HMM' object has no attribute '_do_forward_pass'

@mnschmit
Copy link

I installed via pip and got the same error when trying to fit the HMM.

@david-waterworth
Copy link

_do_forward_pass comes from the hmmlearn dependency. It's working for me, I have hmmlearn==0.2.6 and scikit-learn==1.0.2. I wonder if you have an older version installed?

@ManuBohra
Copy link
Author

ManuBohra commented Feb 16, 2022

I have hmmlearn==0.2.7 and meet with all requirements that is stated in requirements.txt

*python 3.6.9

@mnschmit
Copy link

@david-waterworth thanks a lot for the hint! It seems that hmmlearn renamed the "missing" functions to _do_forward_log_pass, _do_backward_log_pass, and _compute_posteriors_log when they introduced the faster alternative called scaling.
Probably, skweak could simply rename the calls to these three functions and it would work with the newer version of hmmlearn but to avoid any other issue, I simply downgraded by explicitly stating hmmlearn==0.2.6 (I also had .7 before just like @ManuBohra).

Now it works for me. I only get a lot of RuntimeWarning: invalid value encountered in subtract during model inference. I can ignore them with numpy.errstate but should I worry about them? Do you get these, too, @david-waterworth ?

@plison
Copy link
Collaborator

plison commented Feb 16, 2022

Yes, the error seems to be due to a change in hmmlearn. We are soon going to release a new version of skweak which fixes this issue along with other improvements, stay tuned :-) In the meantime, yes, as suggested by @mnschmit , you can either downgrade to hmmlearn==0.2.6, or edit the aggregation.py module to use the new function names from hmmlearn.
Regarding the warning message ('invalid value encountered in substract'), I don't really know.

@mnschmit
Copy link

Thanks for the confirmation @plison I'll watch the repository to avoid missing the new release!

The warning message occurs here. hmmlearn seems to return invalid values here. Maybe this is also due to the older version I am using now. I hope it'll be fixed with the new release, too!

@ljvmiranda921
Copy link

Agree, I was able to fix this by pinning the following dependencies in requirements.txt

skweak==0.2.13
hmmlearn==0.2.6

@martarho
Copy link

It seems that additionally to the functions above, _compute_log_xi_sum is also not supported anymore, or at least can't be found.

Do you know when will you release the new version? And if not soon, what would be a suitable fix for this?

@plison
Copy link
Collaborator

plison commented Mar 16, 2022

I hope to be able to release the new version by next week. But a quick fix would be to downgrade hmmlearn to a previous version, which does include _compute_log_xi_sum, _do_forward_pass and those other functions.

@plison
Copy link
Collaborator

plison commented Mar 24, 2022

Should be fixed in the new version that was just released!

@plison plison closed this as completed Mar 24, 2022
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

6 participants