Python API¶
The MNIST Database is a database of handwritten digits, which has a training set of 60,000 examples, and a test set of 10,000 examples. It is a subset of a larger set available from NIST. The digits have been size-normalized and centered in a fixed-size image.
-
class
bob.db.mnist.
Database
¶ Bases:
object
Wrapper class for the MNIST database of handwritten digits.
The original database files are distributed over: http://yann.lecun.com/exdb/mnist/.
-
data
(groups=None, labels=None)[source]¶ Loads the MNIST samples and labels and returns them in NumPy arrays
Parameters: Returns: A 2D array representing the digit images, with as many rows as examples in the dataset, as many columns as pixels (actually, there are 28x28 = 784 rows). The pixels of each image are unrolled in C-scan order (i.e., first row 0, then row 1, etc.)
numpy.ndarray: A 1D array with as many elements as examples in the dataset, containing the labels for each image returned above.
Return type:
-