2

This is, I think, a math puzzle, but it will take a bit to explain.

I wanted to create a subset of loosely defined "similar" digits from the MNIST dataset. MNIST is a dataset of grayscale, handwritten digits, 0-9. They are represented as ($32 \times 32$)-dimensional integer vectors with the values 0 (black) to 255 (white).

To find clusters of similar digits, for each class of digit I selected the 200 most similar digits as measured by the cosine distance with respect to a randomly selected base digit.

The only problem is, my data was loaded into NumPy as an 8-bit integer array. The result is that I miscomputed the cosine distance as can be seen here.

Here's the weird thing: my script sort of worked. After realizing that the cosine distance was being incorrectly computed due to an overflow error, I did a sanity check. For every digit in the original MNIST dataset, I computed its sum, and then took 200 digits from each class with the smallest sums. When I compared the overlap, 26% of the digits in the faux-cosine-distance dataset were in the smallest-sums dataset.

Is there any reasonable hypothesis as to why this seems to work?

jds
  • 2,274
  • 3
  • 24
  • 35

0 Answers0