univariate.py 文件源码

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

项目:zhusuan 作者: thu-ml 项目源码 文件源码
def _log_prob(self, given):
        mean, logstd = self.path_param(self.mean), \
                       self.path_param(self.logstd)
        c = -0.5 * (np.log(2.0) + np.log(np.pi))
        precision = tf.exp(-2.0 * logstd)
        if self._check_numerics:
            precision = tf.check_numerics(precision, "precision")
        mask = tf.log(tf.cast(given >= 0., dtype=precision.dtype))
        return (c - (logstd + 0.5 * precision * tf.square(given - mean)) + \
                tf.nn.softplus(-2.0 * mean * given * precision)) + mask
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号