Burn WASM (simd) MNIST Web Inference
  • JavaScript 49.2%
  • Rust 31.4%
  • HTML 16%
  • Shell 3.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-01-04 09:54:19 +04:00
pkg feat: add training code, WIP, merge wasm and training code properly 2025-01-04 09:52:57 +04:00
src add data and training files 2025-01-04 09:54:19 +04:00
.gitignore first commit 2025-01-04 00:39:50 +04:00
build-for-web.sh first commit 2025-01-04 00:39:50 +04:00
Cargo.lock feat: add training code, WIP, merge wasm and training code properly 2025-01-04 09:52:57 +04:00
Cargo.toml feat: add training code, WIP, merge wasm and training code properly 2025-01-04 09:52:57 +04:00
CNAME Create CNAME 2025-01-04 00:40:55 +04:00
index.html first commit 2025-01-04 00:39:50 +04:00
index.js first commit 2025-01-04 00:39:50 +04:00
model.bin first commit 2025-01-04 00:39:50 +04:00
README.md feat: add training code, WIP, merge wasm and training code properly 2025-01-04 09:52:57 +04:00
run-server.sh first commit 2025-01-04 00:39:50 +04:00

MNIST Inference on Web Using Rust and Wasm (simd)

Running

  1. Build

    ./build-for-web.sh
    
  2. Run the server

    ./run-server.sh
    
  3. Open the http://localhost:8000/ in the browser.

Model

Layers:

  1. Input Image (28,28, 1ch)
  2. Conv2d(3x3, 8ch), BatchNorm2d, Gelu
  3. Conv2d(3x3, 16ch), BatchNorm2d, Gelu
  4. Conv2d(3x3, 24ch), BatchNorm2d, Gelu
  5. Linear(11616, 32), Gelu
  6. Linear(32, 10)
  7. Softmax Output

The total number of parameters is 376,952.

The model is trained with 4 epochs and the final test accuracy is 98.67%.

The training and hyper parameter information in can be found in training.rs.

Resources

  1. Rust 🦀 and WebAssembly
  2. wasm-bindgen