nasnet_utils.py 文件源码

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

项目:Classification_Nets 作者: BobLiu20 项目源码 文件源码
def drop_path(net, keep_prob, is_training=True):
  """Drops out a whole example hiddenstate with the specified probability."""
  if is_training:
    batch_size = tf.shape(net)[0]
    noise_shape = [batch_size, 1, 1, 1]
    random_tensor = keep_prob
    random_tensor += tf.random_uniform(noise_shape, dtype=tf.float32)
    binary_tensor = tf.floor(random_tensor)
    net = tf.div(net, keep_prob) * binary_tensor
  return net
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号