View Source Scidata.FashionMNIST (Scidata v0.1.11)
Module for downloading the FashionMNIST dataset.
Link to this section Summary
Functions
Downloads the FashionMNIST training dataset or fetches it locally.
Downloads the FashionMNIST test dataset or fetches it locally.
Link to this section Functions
Downloads the FashionMNIST 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)))
options
Options.
:base_url
- Dataset base URL.Defaults to
"http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/"
:train_image_file
- Training set image filename.Defaults to
"train-images-idx3-ubyte.gz"
:train_label_file
- Training set label filename.Defaults to
"train-images-idx1-ubyte.gz"
:cache_dir
- Cache directory.Defaults to
System.tmp_dir!()
examples
Examples
iex> Scidata.FashionMNIST.download()
{{<<105, 109, 97, 103, 101, 115, 45, 105, 100, 120, 51, 45, 117, 98, 121, 116,
101, 0, 236, 253, 7, 88, 84, 201, 215, 232, 11, 23, 152, 38, 57, 51, 166,
81, 71, 157, 209, 49, 135, 49, 141, 99, 206, 142, 57, 141, 89, 68, ...>>,
{:u, 8}, {3739854681, 226418, 1634299437}},
{<<0, 3, 116, 114, 97, 105, 110, 45, 108, 97, 98, 101, 108, 115, 45, 105, 100,
120, 49, 45, 117, 98, 121, 116, 101, 0, 53, 221, 9, 130, 36, 73, 110, 100,
81, 219, 220, 150, 91, 214, 249, 251, 20, 141, 247, 53, 114, ...>>, {:u, 8},
{3739854681}}}
Downloads the FashionMNIST test dataset or fetches it locally.
options
Options.
:base_url
- Dataset base URL.Defaults to
"http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/"
:test_image_file
- Test set image filename.Defaults to
"t10k-images-idx3-ubyte.gz"
:test_label_file
- Test set label filename.Defaults to
"t10k-labels-idx1-ubyte.gz"
:cache_dir
- Cache directory.Defaults to
System.tmp_dir!()