layer.py 文件源码

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

项目:deep_srl 作者: luheng 项目源码 文件源码
def connect(self, inputs, is_train):
    """ Trick to speed up model compiling at decoding time.
        (Avoids building a complicated CG.)
    """
    if not self.fix_mask:
      self.generate_mask(inputs.shape, is_train)

    if self.fast_predict:
      return inputs * (1 - self.dropout_prob)

    return ifelse(is_train,
            inputs * self.dropout_mask,
            inputs * (1 - self.dropout_prob))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号