In [1]:
from tensorflow.examples.tutorials.mnist import input_data
mnist=input_data.read_data_sets('MNIST_data',one_hot=True)
In [2]:
batch=mnist.train.next_batch(3)
In [3]:
batch
Out[3]:
In [5]:
x=batch[0]
y=batch[1]
In [7]:
y[0]
Out[7]:
In [9]:
x[0].shape
Out[9]:
In [20]:
import numpy as np
img=np.reshape(x[0], newshape=(28, -1))
In [21]:
%matplotlib inline
from matplotlib import pyplot as plt
plt.imshow(img,cmap='gray')
Out[21]:
In [ ]: