poisson.py 文件源码

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

项目:tensorprob 作者: tensorprob 项目源码 文件源码
def Poisson(lambda_, name=None):
    k = tf.placeholder(config.int_dtype, name=name)

    # FIXME tf.lgamma only supports floats so cast before
    Distribution.logp = (
        tf.cast(k, config.dtype)*tf.log(lambda_) -
        lambda_ -
        tf.lgamma(tf.cast(k+1, config.dtype))
    )

    # TODO Distribution.integral = ...
    def integral(l, u):
        return tf.constant(1, dtype=config.dtype)
    Distribution.integral = integral

    return k
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号