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

GMM-HMM: Simplifiy / Explicitly refer to literature for implementation #516

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blckmaxima
Copy link
Contributor

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.

@blckmaxima blckmaxima mentioned this pull request Apr 3, 2023
@blckmaxima
Copy link
Contributor Author

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).

@blckmaxima blckmaxima force-pushed the standardize-gmm branch 2 times, most recently from fcd26f2 to 8ac1716 Compare January 20, 2024 14:37
@blckmaxima
Copy link
Contributor Author

@anntzer Thinking of merging this (and the Variational GMM work), and making a release in the coming weeks... thoughts?

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_
Copy link
Contributor

@anntzer anntzer Feb 21, 2024

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...)

Copy link
Contributor Author

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.

    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.
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

Successfully merging this pull request may close these issues.

2 participants