hmm.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:NetPower_TestBed 作者: Vignesh2208 项目源码 文件源码
def _generate_sample_from_state(self, state, random_state=None):
        if random_state is None:
            random_state = self.random_state
        random_state = check_random_state(random_state)

        cur_means = self.means_[state]
        cur_covs = self.covars_[state]
        cur_weights = self.weights_[state]

        i_gauss = random_state.choice(self.n_mix, p=cur_weights)
        mean = cur_means[i_gauss]
        if self.covariance_type == 'tied':
            cov = cur_covs
        else:
            cov = cur_covs[i_gauss]

        return sample_gaussian(mean, cov, self.covariance_type,
                               random_state=random_state)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号