This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" A function that can read MNIST's idx file format into numpy arrays. | |
The MNIST data files can be downloaded from here: | |
http://yann.lecun.com/exdb/mnist/ | |
This relies on the fact that the MNIST dataset consistently uses | |
unsigned char types with their data segments. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NR == 1 {sep=""} | |
NR > 2 {sep=","} | |
{ | |
if (NR == 1) { | |
split($0, tags); | |
if (EC == "") EC = "\""; | |
} | |
else { | |
split($0, vals); | |
jrec = sep"{"; |