Last active
January 1, 2016 12:05
-
-
Save grim13b/501978d8158d71526975 to your computer and use it in GitHub Desktop.
TensorFlowのtutorialにあるmnistデータをImageで表示する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import tensorflow.examples.tutorials.mnist.input_data as input_data | |
import numpy | |
import matplotlib.pyplot as pyplot | |
import matplotlib.cm as cm | |
from PIL import Image | |
mnist = input_data.read_data_sets('./MNIST_data', one_hot=True) | |
data = mnist.train | |
pyplot.imshow(Image.fromarray(numpy | |
.uint8(data.images[0] * 255) | |
.reshape(28, 28)) | |
, cmap = cm.Greys_r) | |
print('Number:{0}'.format(data.labels[0].argmax())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment