2014-02-25 10:22:30 +04:00
|
|
|
#!/usr/bin/env sh
|
2014-08-29 18:04:24 +04:00
|
|
|
# This script converts the mnist data into leveldb/lmdb format,
|
|
|
|
# depending on the value assigned to $BACKEND.
|
2014-02-25 10:22:30 +04:00
|
|
|
|
2014-08-29 03:34:57 +04:00
|
|
|
EXAMPLE=examples/mnist
|
|
|
|
DATA=data/mnist
|
|
|
|
BUILD=build/examples/mnist
|
2014-08-29 19:04:25 +04:00
|
|
|
|
2014-08-29 18:04:24 +04:00
|
|
|
BACKEND="lmdb"
|
2014-02-25 10:22:30 +04:00
|
|
|
|
2014-08-29 18:04:24 +04:00
|
|
|
echo "Creating ${BACKEND}..."
|
2014-02-25 10:22:30 +04:00
|
|
|
|
2014-08-29 18:04:24 +04:00
|
|
|
rm -rf $EXAMPLE/mnist_train_${BACKEND}
|
|
|
|
rm -rf $EXAMPLE/mnist_test_${BACKEND}
|
2014-02-25 10:22:30 +04:00
|
|
|
|
2014-08-29 03:34:57 +04:00
|
|
|
$BUILD/convert_mnist_data.bin $DATA/train-images-idx3-ubyte \
|
2014-08-31 16:27:33 +04:00
|
|
|
$DATA/train-labels-idx1-ubyte $EXAMPLE/mnist_train_${BACKEND} --backend=${BACKEND}
|
2014-08-29 03:34:57 +04:00
|
|
|
$BUILD/convert_mnist_data.bin $DATA/t10k-images-idx3-ubyte \
|
2014-08-31 16:27:33 +04:00
|
|
|
$DATA/t10k-labels-idx1-ubyte $EXAMPLE/mnist_test_${BACKEND} --backend=${BACKEND}
|
2014-02-25 10:22:30 +04:00
|
|
|
|
|
|
|
echo "Done."
|