Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # reading the training images matrix
- train = mnist.train.images
- image_dim = 28
- # printing some images with their labels
- plt.figure(1)
- for i in range(25):
- plt.subplot(5,5,i+1)
- flatten_img = train[i]
- # recreating the 28*28 image matrix from feature vector
- img = flatten_img.reshape([image_dim,image_dim])
- # Scaling it to [0,255] range -- greyscale
- img = np.uint8(img*255)
- plt.axis('off')
- plt.imshow(img,cmap='gray')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement