burn/examples/mnist
Dilshod Tadjibaev bf9d33e6fc
Add MNIST inference on the web demo crate (#228)
* Add MNIST inference on the web demo crate

* Fix problems identified during a PR review
2023-03-13 19:51:32 -04:00
..
examples Add MNIST inference on the web demo crate (#228) 2023-03-13 19:51:32 -04:00
src Add MNIST inference on the web demo crate (#228) 2023-03-13 19:51:32 -04:00
Cargo.toml Add accelerate framework support for burn-ndarray (#183) (#184) 2023-02-28 09:09:47 -05:00
README.md doc: update readme (#112) 2022-11-20 19:41:55 -05:00

README.md

MNIST

The example is showing you how to:

  • Define your own custom module (MLP).
  • Create the data pipeline from a raw dataset to a batched multi-threaded fast DataLoader.
  • Configure a learner to display and log metrics as well as to keep training checkpoints.

The example can be run like so:

git clone https://github.com/burn-rs/burn.git
cd burn
# Use the --release flag to really speed up training.
echo "Using ndarray backend"
cargo run --example mnist --release --features ndarray                # CPU NdArray Backend - f32 - single thread
cargo run --example mnist --release --features ndarray-blas-openblas  # CPU NdArray Backend - f32 - blas with openblas
cargo run --example mnist --release --features ndarray-blas-netlib    # CPU NdArray Backend - f32 - blas with netlib
echo "Using tch backend"
export TORCH_CUDA_VERSION=cu113                                       # Set the cuda version
cargo run --example mnist --release --features tch-gpu                # GPU Tch Backend - f16
cargo run --example mnist --release --features tch-cpu                # CPU Tch Backend - f32