gaussian_components.py 文件源码

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

项目:segmentalist 作者: kamperh 项目源码 文件源码
def _update_logdet_covar_and_inv_covar(self, k):
        """
        Update the covariance terms for component `k`.

        Based on the `m_N_numerators` and `S_N_partials` terms for the `k`th
        component, the `logdet_covars` and `inv_covars` terms are updated.
        """
        k_N = self.prior.k_0 + self.counts[k]
        v_N = self.prior.v_0 + self.counts[k]
        m_N = self.m_N_numerators[k]/k_N
        covar = (k_N + 1.)/(k_N*(v_N - self.D + 1.)) * (self.S_N_partials[k] - k_N*np.outer(m_N, m_N))
        self.logdet_covars[k] = slogdet(covar)[1]
        self.inv_covars[k, :, :] = inv(covar)

    # @profile
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号