Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created January 5, 2021 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AyishaR/9a22a2a9aae13aeb7c2d53cbd075d869 to your computer and use it in GitHub Desktop.
Save AyishaR/9a22a2a9aae13aeb7c2d53cbd075d869 to your computer and use it in GitHub Desktop.
# Normalizing the pixel values for faster convergence
normalization_layer = layers.experimental.preprocessing.Rescaling(1./255)
train_ds = train_ds.map(lambda x, y: (normalization_layer(x), y))
test_ds = test_ds.map(lambda x, y: (normalization_layer(x), y))
val_ds = val_ds.map(lambda x, y: (normalization_layer(x), y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment