Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Created October 11, 2016 10:21
Show Gist options
  • Save kaityo256/d97621bf5e79ed08678d708b12853653 to your computer and use it in GitHub Desktop.
Save kaityo256/d97621bf5e79ed08678d708b12853653 to your computer and use it in GitHub Desktop.
MNISTのデータを可視化するサンプル
import chainer
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--number', '-n', type=int, default=0, help='')
args = parser.parse_args()
n = args.number
train, test = chainer.datasets.get_mnist()
s = 28
print test[n][1]
for i in range(1,28):
for j in range
v = test[n][0][j + i*s]
if v > 0.1:
print "*",
else:
print " ",
print "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment