summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYangqing Jia <jiayq84@gmail.com>2013-09-30 14:10:04 -0700
committerYangqing Jia <jiayq84@gmail.com>2013-09-30 14:10:04 -0700
commiteae32438ecd880f9d71bd693ed1d341ded4d6ace (patch)
tree72247b51ab65ae2508e9aed4b65ea59b18a91c34 /src
parentf171796995d17e3db4b4752a116e532d499dc91f (diff)
downloadcaffeonacl-eae32438ecd880f9d71bd693ed1d341ded4d6ace.tar.gz
caffeonacl-eae32438ecd880f9d71bd693ed1d341ded4d6ace.tar.bz2
caffeonacl-eae32438ecd880f9d71bd693ed1d341ded4d6ace.zip
mnist network generation
Diffstat (limited to 'src')
-rw-r--r--src/caffe/test/data/mnist.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/caffe/test/data/mnist.py b/src/caffe/test/data/mnist.py
index d478dc79..02ae7f57 100644
--- a/src/caffe/test/data/mnist.py
+++ b/src/caffe/test/data/mnist.py
@@ -17,4 +17,14 @@ for i in range(60000):
datum = convert.array_to_datum((mnist._data[i] * 255).reshape(1,28,28).astype(np.uint8))
datum.label = mnist._label[i]
db.Put('%d' % (i), datum.SerializeToString())
-del db \ No newline at end of file
+del db
+
+mnist = core_layers.MNISTDataLayer(
+ rootfolder=MNIST_ROOT, name='mnist', is_training = False)
+db = leveldb.LevelDB('mnist-test-leveldb')
+
+for i in range(10000):
+ datum = convert.array_to_datum((mnist._data[i] * 255).reshape(1,28,28).astype(np.uint8))
+ datum.label = mnist._label[i]
+ db.Put('%d' % (i), datum.SerializeToString())
+del db