facebookresearch/qmnist

How to format my own images to match the MNIST Dataset?

zhuqunxi opened this issue · 1 comments

Dear friend,

How to format my own images (such as the following image) to match the MNIST Dataset? Thanks.
image

This is not really an issue with the qmnist dataset and code.

I suggest you read the paper. Then you can check function fim_mnist_prepro at

(de fim-mnist-prepro(fim)
which takes a floating point image (a float tensor hxwx3) and produces a unsigned byte image (a uint8 tensor 28x28x3) that can then be written into a mnist-like image file with function save-idx3-ubyte. This function rescales, recenters, and discretize in a way that we believe is quite close to what was done with mnist.

Now all this is written in Lush which is a deep learning framework that predates PyTorch by two or three decades (and even predates Python by one decade). It is superficially very different but was largely copied in further frameworks (e.g. the use of tensors, the tensor compiler design, etc.) You can learn about lush at lush.sf.net.