gp.py 文件源码

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

项目:product-taz 作者: TheAnomalieZ 项目源码 文件源码
def log_likelihood(self):
        """
        GP Marginal likelihood

        Notes
        -----
        This is called by the samplers when fitting the hyperparameters.
        """
        cov   = self.kernel.cov(self.observed_inputs)
        chol  = spla.cholesky(cov, lower=True)
        solve = spla.cho_solve((chol, True), self.observed_values - self.mean.value)

        # Uses the identity that log det A = log prod diag chol A = sum log diag chol A
        return -np.sum(np.log(np.diag(chol)))-0.5*np.dot(self.observed_values - self.mean.value, solve)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号