module_cell.py 文件源码

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

项目:dnnQuery 作者: richardxiong 项目源码 文件源码
def _variational_recurrent_dropout_value(
      self, index, value, noise, keep_prob):
    """Performs dropout given the pre-calculated noise tensor."""
    # uniform [keep_prob, 1.0 + keep_prob)
    random_tensor = keep_prob + noise

    # 0. if [keep_prob, 1.0) and 1. if [1.0, 1.0 + keep_prob)
    binary_tensor = math_ops.floor(random_tensor)
    ret = math_ops.div(value, keep_prob) * binary_tensor
    ret.set_shape(value.get_shape())
    return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号