Created
October 11, 2016 10:21
-
-
Save kaityo256/d97621bf5e79ed08678d708b12853653 to your computer and use it in GitHub Desktop.
MNISTのデータを可視化するサンプル
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
| 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