test_online_GMM.py 文件源码

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

项目:megamix 作者: 14thibea 项目源码 文件源码
def test_update(self,window):
        points = np.random.randn(self.n_points,self.dim)
        GM = GaussianMixture(self.n_components,window=window,update=True)

        GM.initialize(points)
        GM.fit(points)

        expected_cov_chol = np.zeros((self.n_components,self.dim,self.dim))
        for i in range(self.n_components):
            expected_cov_chol[i] = linalg.cholesky(GM.get('cov')[i],lower=True)

        predected_cov_chol = GM.get('cov_chol')

        assert_almost_equal(expected_cov_chol,predected_cov_chol)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号