Skip to content

Instantly share code, notes, and snippets.

@Sanlap1997
Created September 24, 2020 08:23
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 Sanlap1997/7de846fb089a5f7731c6b76d8c4e6014 to your computer and use it in GitHub Desktop.
Save Sanlap1997/7de846fb089a5f7731c6b76d8c4e6014 to your computer and use it in GitHub Desktop.
import tensorflow as tf
import numpy as np
print("TensorFlow's version is", tf.__version__)
print("Keras' version is", tf.keras.__version__)
# Normalize training and testing pixel values
X_train_normalized = X_train / 255 - 0.5
X_test_normalized = X_test / 255 - 0.5
# Convert class vectors to binary class matrices.
Y_train_coded = tf.keras.utils.to_categorical(Y_train, NUM_CLASSES)
Y_test_coded = tf.keras.utils.to_categorical(Y_test, NUM_CLASSES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment