normal_trunc.py 文件源码

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

项目:cgpm 作者: probcomp 项目源码 文件源码
def logpdf(self, rowid, targets, constraints=None, inputs=None):
        DistributionGpm.logpdf(self, rowid, targets, constraints, inputs)
        x = targets[self.outputs[0]]
        if not (self.l <= x <= self.h):
            return -float('inf')
        logpdf_unorm = NormalTrunc.calc_predictive_logp(
            x, self.mu, self.sigma, self.l, self.h)
        logcdf_norm = NormalTrunc.calc_log_normalizer(
            self.mu, self.sigma, self.l, self.h)
        return logpdf_unorm - logcdf_norm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号