-
Notifications
You must be signed in to change notification settings - Fork 739
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
GMM-HMM: Simplifiy / Explicitly refer to literature for implementation #516
base: main
Are you sure you want to change the base?
Conversation
This changes the implementation, so I'm aware that we should be cautious before merging. However, I like that the implementation clearly follows a reference. I've called out in the code where I didn't have any references (nor where I could find a reason for what was going on). |
033ceb8
to
91f7ce9
Compare
fcd26f2
to
8ac1716
Compare
@anntzer Thinking of merging this (and the Variational GMM work), and making a release in the coming weeks... thoughts? |
lib/hmmlearn/_emissions.py
Outdated
if 'm' in self.params: # means stats | ||
stats['m_n'] += np.einsum('ijk,il->jkl', post_comp_mix, X) | ||
|
||
if 'c' in self.params: # covariance stats | ||
centered = X[:, None, None, :] - self.means_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a quick skimming, if I understand correctly (I didn't actually check the formulas), this is something akin replacing var(X) = <(X - <X>)^2>
by var(X) = <X^2> - <X>^2
? (you don't center the X's anymore)? Do you know if one approach is better/faster/more numerically accurate than the other?
Other than that I guess this looks reasonable? (Again, without actually checking the math...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, that I don't immediately know the answer to. Let me look at something.
8ac1716
to
932baea
Compare
Watanabe, Shinji, and Jen-Tzung Chien. Bayesian Speech and Language Processing. Cambridge University Press, 2015. which appears simpler than the current implementation. This will make the VariationalGMMHMM Easier to implement later on.
932baea
to
d2e3295
Compare
Re-implement GMMHMM based upon Newer Reference
Watanabe, Shinji, and Jen-Tzung Chien. Bayesian Speech and Language
Processing. Cambridge University Press, 2015.
which appears simpler than the current implementation. This will make the VariationalGMMHMM Easier to implement later on.