MNIST¶
Various functions for accessing the MNIST dataset.
-
dynn.data.mnist.
download_mnist
(path='.', force=False)¶ Downloads MNIST from “http://yann.lecun.com/exdb/mnist/”
Parameters:
-
dynn.data.mnist.
load_mnist
(path)¶ Loads the MNIST dataset
Returns MNIST as a dictionary.
Example:
mnist = load_mnist(".") # Train images and labels train_imgs, train_labels = mnist["train"] # Test images and labels test_imgs, test_labels = mnist["test"]
The images are represented as numpy arrays and the labels as integers.
Parameters: path (str) – Path to the folder containing the *-ubyte.gz
filesReturns: MNIST dataset Return type: dict
-
dynn.data.mnist.
read_mnist
(split, path)¶ Iterates over the MNIST dataset
Example:
for image in read_mnist("train", "/path/to/mnist"): train(image)
Parameters: Returns: image, label
Return type: