def _normalize ( image ) : offset = tf . constant ( MEAN_RGB , shape = [ 1 , 1 , 3 ] ) image -= offset scale = tf . constant ( STDDEV_RGB , shape = [ 1 , 1 , 3 ] ) image /= scale return image
normalize cifar10 input python with tensorflow
Normalize the image to zero mean and unit variance .
def _normalize(image):
  """Normalize the image to zero mean and unit variance."""
  offset = tf.constant(MEAN_RGB, shape=[1, 1, 3])
  image -= offset

  scale = tf.constant(STDDEV_RGB, shape=[1, 1, 3])
  image /= scale
  return image