How to use the hmmlearn.hmm.GMMHMM function in hmmlearn

To help you get started, we’ve selected a few hmmlearn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github drbinliang / Speech_Recognition / src / utils.py View on Github external
def getHmmModel(self):
        ''' get hmm model from training data '''

        # GaussianHMM
#         model = hmm.GaussianHMM(numStates, "diag") # initialize hmm model

        # Gaussian Mixture HMM
        model = hmm.GMMHMM(n_components = self.nComp, n_mix = self.nMix, \
                           transmat_prior = self.transmatPrior, startprob_prior = self.startprobPrior, \
                           covariance_type = self.covarianceType, n_iter = self.n_iter)
        model.fit(self.trainData)   # get optimal parameters

        self.hmmModel = model
github HongminWu / time_series_anomaly_detection_classification_clustering / HMM / hmm_for_baxter_using_only_success_trials / model_generation.py View on Github external
init_new_score_level()
                for n_mix in model_config['GMM_state_amount']:
                    update_last_score_level()
                    if does_bad_score_count_hit(2) and n_mix>5:
                        clear_last_score_level()
                        break

                    init_new_score_level()
                    for n_components in model_config['hmm_hidden_state_amount']:
                        update_last_score_level()
                        if does_bad_score_count_hit(2) and n_components>5:
                            clear_last_score_level()
                            break

                        model = hmmlearn.hmm.GMMHMM(
                            n_components=n_components,
                            n_mix=n_mix,
                            covariance_type=covariance_type,
                            params="mct",
                            init_params="cmt",
                            n_iter=n_iter)
                        start_prob = np.zeros(n_components)
                        start_prob[0] = 1
                        model.startprob_ = start_prob

                        now_model_config = {
                            "hmm_hidden_state_amount": n_components,
                            "gaussianhmm_covariance_type_string": covariance_type,
                            "hmm_max_train_iteration": n_iter,
                            "GMM_state_amount": n_mix,
                        }
github avewells / audio-sentiment-analysis-pipeline / audio_sentiment_analysis / hmm_morency.py View on Github external
def build_hmm(n_components, n_mix):
            '''
            Create models with passed parameters.
            '''
            model = hmm.GMMHMM(n_components=n_components, n_mix=n_mix, random_state=random_state)
            return model
        self.hmm_0 = build_hmm(n_components, n_mix)