Skip to content

Instantly share code, notes, and snippets.

@Steboss89
Created August 12, 2022 15:58
Show Gist options
  • Save Steboss89/c96a7d0cc367e5e580b1261575bdbca1 to your computer and use it in GitHub Desktop.
Save Steboss89/c96a7d0cc367e5e580b1261575bdbca1 to your computer and use it in GitHub Desktop.
Download the MNIST with mnist
use mnist::*;
fn main()-> Result<(), Box<dyn, Error>>{
// Deconstruct the returned Mnist struct.
let Mnist {
trn_img,
trn_lbl,
val_img,
val_lbl,
tst_img,
tst_lbl,
} = MnistBuilder::new()
.download_and_extract()
.label_format_digit()
.training_set_length(TRAIN_SIZE as u32)
.validation_set_length(VAL_SIZE as u32)
.test_set_length(TEST_SIZE as u32)
.finalize();
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment