def coin_flip(prob=.5):
"""Random boolean variable, with `prob` chance of being true.
Used to choose between local and global drop path.
Args:
prob:float, probability of being True.
"""
with tf.variable_op_scope([],None,"CoinFlip"):
coin = tf.random_uniform([1])[0]>prob
return coin
评论列表
文章目录