Using if conditions inside a TensorFlow graph
问题 In tensorflow CIFAR-10 tutorial in cifar10_inputs.py line 174 it is said you should randomize the order of the operations random_contrast and random_brightness for better data augmentation. To do so the first thing I think of is drawing a random variable from the uniform distribution between 0 and 1 : p_order. And do: if p_order>0.5: distorted_image=tf.image.random_contrast(image) distorted_image=tf.image.random_brightness(distorted_image) else: distorted_image=tf.image.random_brightness