I've been reading Barbara Oakley's book A mind for numbers: How to excel at math and science (even if you flunked algebra). Although the book nominally makes reference to math and science, it is actually a more general set of recommendations on how to study based on research in cognitive science. One of the insights in the book is that we can sometimes narrow our search space prematurely when trying to discover the answer to a problem. This can lead to a sub-optimal solution, perhaps even no solution, as we have framed the problem in such a way as to exclude a more fruitful path of exploration.
This happened to me this past weekend as I was trying to play around with the Extended MNIST (EMNIST) data set which includes both handwritten digits and handwritten letters. I had been working through a Tensorflow tutorial on training a classifier on the handwritten digit MNIST data (which is kind of like the "hello world" of machine learning) and I wanted to extend it to letters as well. Because of its ubiquity as an example, Tensorflow includes a script to download the MNIST data set. I was modifying that to read the EMNIST data that I had downloaded to my local machine.
Even though I had changed the variables which referred to the EMNIST files rather than the MNIST files, I couldn't figure out why I was getting a cannot open file error. My assumption was that it had something to do with how I was setting the relative path to the files, as the original script will go the the internet to download the data if it is not found locally and that where I was making the bulk of the changes. However, no matter what I tried (including specifying absolute rather than relative paths), I kept getting the same error. It was only after an inordinate amount of time that I realized my error was a typo* in the file name rather than an error in the logic of the program itself (emnist-byclass-test-labels-idx1--ubyte.gz versus emnist-byclass-test-labels-idx1-ubyte.gz).
The moral of the story is that it pays to take a step back and consider additional possibilities for where a problem lies rather than rushing headlong into the first possibility.
*If you couldn't see it, I'm talking about the extra hyphen.
Tuesday, February 13, 2018
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment