Skip to content

Instantly share code, notes, and snippets.

@xoraus
Last active August 22, 2019 12:42
Show Gist options
  • Save xoraus/9c1af00b37b3dbd06be7440b4b56c5c4 to your computer and use it in GitHub Desktop.
Save xoraus/9c1af00b37b3dbd06be7440b4b56c5c4 to your computer and use it in GitHub Desktop.
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
print(‘Training Data: {}’.format(x_train.shape))
print(‘Training Labels: {}’.format(y_train.shape))
Training Data: (60000L, 28L, 28L)
Training Labels: (60000L,)
print(‘Testing Data: {}’.format(x_test.shape))
print(‘Testing Labels: {}’.format(y_test.shape))
Testing Data: (10000L, 28L, 28L)
Testing Labels: (10000L,)
# EDA
fig, axs = plt.subplots(3, 3, figsize = (12, 12))
plt.gray()
for i, ax in enumerate(axs.flat):
ax.matshow(x_train[i])
ax.axis(‘off’)
ax.set_title(‘Number {}’.format(y_train[i]))
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment