def scheduled_sample(ground_truth_x, generated_x, batch_size, num_ground_truth):
 idx = tf.random_shuffle(tf.range(int(batch_size)))
 ground_truth_idx = tf.gather(idx, tf.range(num_ground_truth))
 generated_idx = tf.gather(idx, tf.range(num_ground_truth, int(batch_size)))
 ground_truth_examps = tf.gather(ground_truth_x, ground_truth_idx)
 generated_examps = tf.gather(generated_x, generated_idx)
 return tf.dynamic_stitch([ground_truth_idx, generated_idx], [ground_truth_examps, generated_examps])

def scheduled_sample ( ground_truth_x , generated_x , batch_size , num_ground_truth ) : idx = tf . random_shuffle ( tf . range ( int ( batch_size ) ) ) ground_truth_idx = tf . gather ( idx , tf . range ( num_ground_truth ) ) generated_idx = tf . gather ( idx , tf . range ( num_ground_truth , int ( batch_size ) ) ) ground_truth_examps = tf . gather ( ground_truth_x , ground_truth_idx ) generated_examps = tf . gather ( generated_x , generated_idx ) return tf . dynamic_stitch ( [ ground_truth_idx , generated_idx ] , [ ground_truth_examps , generated_examps ] )
sample batch with specified mix of ground truth and generated data points .