Closed jeffhgs closed 5 years ago
I see this as a bugfix, so I have based on master and sent to master.
makes sense, thanks. although, keep in mind that we're not reinventing the wheel as much as we're acting as if we're inventing it. that's a big difference. Chapter 5 is built up from first principles, no external libraries apart from numpy
. and one of the killer features of chapter 6 is to see how incredibly convenient all this suddenly becomes with Keras. In particular, loading data is messy. Same goes for the Go data in later chapters. We could also just provide readers with fully prepared .npy
data and leave out the full data
module, but that's very misleading. Preparing the data is the hard part.
Tested on python 2.7.15 and python 3.6.8.
The code is based a different idea: don't reinvent the wheel that Keras invented to distribute the mnist dataset. The Keras dataset loads mnist from its s3 object, and it works in python 2 and python 3. Its file format turns out to also be a variation on pickle, but their file is created in a way that both python 2 and python 3 unpicklers grok by default. There are several minor differences, and I'm not sure which tricks are the important one. I copied the few lines of their code for dealing with the way they format their dictionaries and checked in their version of the file.