Struct mnist::MnistBuilder [] [src]

pub struct MnistBuilder<'a> { /* fields omitted */ }

Struct used for configuring how to load the MNIST data.

  • lbl_format - Specify how to format the label vectors. Options include:
    • Digit (default) - a single number from 0-9 representing the corresponding digit.
    • OneHotVector - a 1x10 one-hot vector of all 0's except for a 1 at the index of the digit.
      • ex.) 3 -> [0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
  • trn_len - the length of the training set (default = 60,000)
  • val_len - the length of the validation set (default = 0)
  • tst_len - the length of the test set (default = 10,000)
  • base_path - the path to the directory in which to look for the MNIST data files. (default = "data/")
  • trn_img_filename - the filename of the training images data file. (default = "train-images-idx3-ubyte")
  • trn_lbl_filename - the filename of the training labels data file. (default = "train-labels-idx1-ubyte")
  • tst_img_filename - the filename of the test images data file. (default = "10k-images-idx3-ubyte")
  • tst_lbl_filename - the filename of the test labels data file. (default = "t10k-labels-idx1-ubyte")

Methods

impl<'a> MnistBuilder<'a>
[src]

Create a new MnistBuilder with defaults set.

Examples

let mnist = MnistBuilder::new()
   .finalize();

Set the labels format to scalar.

Examples

let mnist = MnistBuilder::new()
    .label_format_digit()
    .finalize();

Set the labels format to vector.

Examples

let mnist = MnistBuilder::new()
    .label_format_one_hot()
    .finalize();

Set the training set length.

Examples

let mnist = MnistBuilder::new()
    .training_set_length(40_000)
    .finalize();

Set the validation set length.

Examples

let mnist = MnistBuilder::new()
    .validation_set_length(10_000)
    .finalize();

Set the test set length.

Examples

let mnist = MnistBuilder::new()
    .test_set_length(10_000)
    .finalize();

Set the base path to look for the MNIST data files.

Examples

let mnist = MnistBuilder::new()
    .base_path("data_sets/mnist")
    .finalize();

Set the training images data set filename.

Examples

let mnist = MnistBuilder::new()
    .training_images_filename("training_images")
    .finalize();

Set the training labels data set filename.

Examples

let mnist = MnistBuilder::new()
    .training_labels_filename("training_labels")
    .finalize();

Set the test images data set filename.

Examples

let mnist = MnistBuilder::new()
    .test_images_filename("test_images")
    .finalize();

Set the test labels data set filename.

Examples

let mnist = MnistBuilder::new()
    .test_labels_filename("test_labels")
    .finalize();

Get the data according to the specified configuration.

Examples

let mnist = MnistBuilder::new()
    .finalize();

Panics

If trn_len + val_len + tst_len > 70,000.

Trait Implementations

impl<'a> Debug for MnistBuilder<'a>
[src]

Formats the value using the given formatter.