Skip to content

Instantly share code, notes, and snippets.

@kumarvipu1
Last active February 2, 2021 18:25
Show Gist options
  • Save kumarvipu1/5f9cb92141cb07fa9177a58b5641a973 to your computer and use it in GitHub Desktop.
Save kumarvipu1/5f9cb92141cb07fa9177a58b5641a973 to your computer and use it in GitHub Desktop.
Part1 of image classifier
# importing libraries
import numpy as np
from tensorflow import keras
from keras.datasets import mnist
#loading dataset
(train_X, train_y), (val_X, val_y) = mnist.load_data()
#normalizing the dataset
train_X, val_X = train_X/255, val_X/255
# visualizing 9 rndom digits from the dataset
for i in range(331,340):
plt.subplot(i)
a = np.random.randint(0, train_X.shape[0], 1)
plt.imshow(train_X[a[0]], cmap = plt.get_cmap('binary'))
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment