(dataset, training)
return dataset
Preprocessing for cifar10 with augmentation (see below).
Preprocessing for cifar10 with augmentation (see below).
Preprocessing for cifar10 with augmentation ( see below ) .
def cifar10_augmentation_preprocess(dataset, training):
  """Preprocessing for cifar10 with augmentation (see below)."""

  def augment(features, targets):
    features['image'] = _cifar_augment_image(features['image'])
    return features, targets

  def cast_image(features, targets):
    features['image'] = tf.cast(features['image'], tf.float32) / 255.0
    return features, targets

  if training:
    dataset = dataset.map(augment)
  dataset = dataset.map(cast_image)
  return dataset
def cifar10_augmentation_preprocess ( dataset , training ) : def augment ( features , targets ) : features [ 'image' ] = _cifar_augment_image ( features [ 'image' ] ) return features , targets def cast_image ( features , targets ) : features [ 'image' ] = tf . cast ( features [ 'image' ] , tf . float32 ) / 255.0 return features , targets if training : dataset = dataset . map ( augment ) dataset = dataset . map ( cast_image ) return dataset