Skip to content

Instantly share code, notes, and snippets.

@xoraus
Created August 22, 2019 12:43
Show Gist options
  • Save xoraus/878701fdb2723211c7c95f5732d1f363 to your computer and use it in GitHub Desktop.
Save xoraus/878701fdb2723211c7c95f5732d1f363 to your computer and use it in GitHub Desktop.
# convert each image to 1 dimensional array
X = x_train.reshape(len(x_train),-1)
Y = y_train
# normalize the data to 0 - 1
X = X.astype(float) / 255.
print(X.shape)
print(X[0].shape)
(60000L, 784L)
(784L,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment