e1ac09e1fc9a6fb3ca3c36c5da6cb4539420a0f9,tutorials/image/cifar10/cifar10_input.py,,distorted_inputs,#Any#Any#,140

Before Change


  filename_queue = tf.train.string_input_producer(filenames)

  // Read examples from files in the filename queue.
  read_input = read_cifar10(filename_queue)
  reshaped_image = tf.cast(read_input.uint8image, tf.float32)

  height = IMAGE_SIZE
  width = IMAGE_SIZE

  // Image processing for training the network. Note the many random
  // distortions applied to the image.

  // Randomly crop a [height, width] section of the image.
  distorted_image = tf.random_crop(reshaped_image, [height, width, 3])

  // Randomly flip the image horizontally.
  distorted_image = tf.image.random_flip_left_right(distorted_image)

  // Because these operations are not commutative, consider randomizing
  // the order their operation.
  // NOTE: since per_image_standardization zeros the mean and makes
  // the stddev unit, this likely has no effect see tensorflow/񳆢.
  distorted_image = tf.image.random_brightness(distorted_image,
                                               max_delta=63)
  distorted_image = tf.image.random_contrast(distorted_image,
                                             lower=0.2, upper=1.8)

  // Subtract off the mean and divide by the variance of the pixels.
  float_image = tf.image.per_image_standardization(distorted_image)

  // Set the shapes of tensors.
  float_image.set_shape([height, width, 3])
  read_input.label.set_shape([1])

  // Ensure that the random shuffling has good mixing properties.
  min_fraction_of_examples_in_queue = 0.4

After Change


  // Create a queue that produces the filenames to read.
  filename_queue = tf.train.string_input_producer(filenames)

  with tf.name_scope("data_augmentation"):
    // Read examples from files in the filename queue.
    read_input = read_cifar10(filename_queue)
    reshaped_image = tf.cast(read_input.uint8image, tf.float32)

    height = IMAGE_SIZE
    width = IMAGE_SIZE

    // Image processing for training the network. Note the many random
    // distortions applied to the image.

    // Randomly crop a [height, width] section of the image.
    distorted_image = tf.random_crop(reshaped_image, [height, width, 3])

    // Randomly flip the image horizontally.
    distorted_image = tf.image.random_flip_left_right(distorted_image)

    // Because these operations are not commutative, consider randomizing
    // the order their operation.
    // NOTE: since per_image_standardization zeros the mean and makes
    // the stddev unit, this likely has no effect see tensorflow/񳆢.
    distorted_image = tf.image.random_brightness(distorted_image,
                                                 max_delta=63)
    distorted_image = tf.image.random_contrast(distorted_image,
                                               lower=0.2, upper=1.8)

    // Subtract off the mean and divide by the variance of the pixels.
    float_image = tf.image.per_image_standardization(distorted_image)

    // Set the shapes of tensors.
    float_image.set_shape([height, width, 3])
    read_input.label.set_shape([1])

    // Ensure that the random shuffling has good mixing properties.
    min_fraction_of_examples_in_queue = 0.4
    min_queue_examples = int(NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN *
                             min_fraction_of_examples_in_queue)
    print ("Filling queue with %d CIFAR images before starting to train. "
           "This will take a few minutes." % min_queue_examples)

  // Generate a batch of images and labels by building up a queue of examples.
  return _generate_image_and_label_batch(float_image, read_input.label,
                                         min_queue_examples, batch_size,
                                         shuffle=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: tensorflow/models
Commit Name: e1ac09e1fc9a6fb3ca3c36c5da6cb4539420a0f9
Time: 2018-01-12
Author: me@stevenhickson.com
File Name: tutorials/image/cifar10/cifar10_input.py
Class Name:
Method Name: distorted_inputs


Project Name: tensorflow/models
Commit Name: e1ac09e1fc9a6fb3ca3c36c5da6cb4539420a0f9
Time: 2018-01-12
Author: me@stevenhickson.com
File Name: tutorials/image/cifar10/cifar10_input.py
Class Name:
Method Name: inputs


Project Name: rlworkgroup/garage
Commit Name: 4ef810643f162aebb1d9efd153a82e0dc9e9094e
Time: 2018-07-20
Author: 35857569+gonzaiva@users.noreply.github.com
File Name: garage/tf/core/layers.py
Class Name: TfBasicLSTMLayer
Method Name: get_output_for


Project Name: rlworkgroup/garage
Commit Name: 4ef810643f162aebb1d9efd153a82e0dc9e9094e
Time: 2018-07-20
Author: 35857569+gonzaiva@users.noreply.github.com
File Name: garage/tf/core/layers.py
Class Name: TfGRULayer
Method Name: get_output_for