Scidata.MNIST (Scidata v0.1.5) View Source

Module for downloading the MNIST dataset.

Link to this section Summary

Functions

Downloads the MNIST training dataset or fetches it locally.

Downloads the MNIST test dataset or fetches it locally.

Link to this section Functions

Downloads the MNIST training dataset or fetches it locally.

Returns a tuple of format:

{{images_binary, images_type, images_shape},
 {labels_binary, labels_type, labels_shape}}

If you want to one-hot encode the labels, you can:

labels_binary
|> Nx.from_binary(labels_type)
|> Nx.new_axis(-1)
|> Nx.equal(Nx.tensor(Enum.to_list(0..9)))

Downloads the MNIST test dataset or fetches it locally.