nnUtils.py 文件源码

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

项目:BinaryNet.tf 作者: itayhubara 项目源码 文件源码
def Dropout(p, name='Dropout'):
    def dropout_layer(x, is_training=True):
        with tf.variable_op_scope([x], None, name):
            # def drop(): return tf.nn.dropout(x,p)
            # def no_drop(): return x
            # return tf.cond(is_training, drop, no_drop)
            if is_training:
                return tf.nn.dropout(x,p)
            else:
                return x
    return dropout_layer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号