Created
August 12, 2022 15:58
-
-
Save Steboss89/c96a7d0cc367e5e580b1261575bdbca1 to your computer and use it in GitHub Desktop.
Download the MNIST with mnist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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