Add the candle-datasets crate (#322)

* Move the vision datasets to a separate crate.

* Move the batcher bits.

* Update the readme.

* Move the tiny-stories bits.

---------

Co-authored-by: Jane Doe <jane.doe@example.org>
This commit is contained in:
Laurent Mazare
2023-08-05 08:56:50 +01:00
committed by GitHub
parent f7b2a0391d
commit 620f83cf66
15 changed files with 163 additions and 125 deletions

View File

@ -63,7 +63,7 @@ struct TrainingArgs {
}
fn training_loop<M: Model>(
m: candle_nn::vision::Dataset,
m: candle_datasets::vision::Dataset,
args: &TrainingArgs,
) -> anyhow::Result<()> {
let dev = candle::Device::cuda_if_available(0)?;
@ -140,7 +140,7 @@ struct Args {
pub fn main() -> anyhow::Result<()> {
let args = Args::parse();
// Load the dataset
let m = candle_nn::vision::mnist::load_dir("data")?;
let m = candle_datasets::vision::mnist::load_dir("data")?;
println!("train-images: {:?}", m.train_images.shape());
println!("train-labels: {:?}", m.train_labels.shape());
println!("test-images: {:?}", m.test_images.shape());