caffe icon indicating copy to clipboard operation
caffe copied to clipboard

When creating levedb in the example of mnist, is it random

Open davidduo opened this issue 12 years ago • 3 comments

Thank very much to 'caffers' for offfering such an interesing thing first. I am not familar with leveldb. What confused me is such a question: when converting own data (written in mnist format) into leveldb format by "examples/mnist/create_mnist.sh", have we disorganized data randomly? Or, when getting data from train-data-leveldb to form batchsize in traing, we pick data randomly? or not ramdom for both?

davidduo avatar Aug 11 '14 13:08 davidduo

I believe the randomization takes place when you convert your data with convert_imageset.

convert_imageset [-g] ROOTFOLDER/ LISTFILE DB_NAME RANDOM_SHUFFLE_DATA[0 or 1] DB_BACKEND[leveldb or lmdb] [resize_height] [resize_width]

If you set the random_shuffle_data to 1, it'll randomize order of the input data.

ashafaei avatar Aug 11 '14 18:08 ashafaei

The MNIST data set is in random order as distributed. The convert_mnist utility does not randomize.

The Caffe convert_imageset utility will also randomize for you as @ashafaei pointed out and the ImageDataLayer can also load the data in random order.

Please continue the discussion on the caffe-users mailing list.

shelhamer avatar Aug 11 '14 22:08 shelhamer

thank you very much@ashafaei and @shelhamer

davidduo avatar Aug 12 '14 03:08 davidduo