An experiment in following neuralnetworksanddeeplearning.com in Rust.
 
 
 
 
Go to file
q3k 61dbe86c2b prepare stuff for public code dump 2023-04-02 13:55:20 +02:00
bigbrain js split 2021-04-03 13:05:13 +02:00
bigbrainjs js split 2021-04-03 13:05:13 +02:00
proto export to proto 2021-04-03 00:21:50 +02:00
src prepare stuff for public code dump 2023-04-02 13:55:20 +02:00
.gitignore feedforward 2021-03-28 15:07:19 +02:00
COPYING prepare stuff for public code dump 2023-04-02 13:55:20 +02:00
Cargo.lock js split 2021-04-03 13:05:13 +02:00
Cargo.toml js split 2021-04-03 13:05:13 +02:00
README.md prepare stuff for public code dump 2023-04-02 13:55:20 +02:00
shell.nix feedforward 2021-03-28 15:07:19 +02:00

README.md

bigbrain

An experiment in following neuralnetworksanddeeplearning.com in Rust. The end result is a web page that can sometimes recognize hand-written digits using a three-layer (one hidden) neural network.

A digit '3' being written in a JS canvas, with the probability of the output being any of the digits 0-9 displayed on a bar graph underneath it.

You can see it in action at https://hackerspace.pl/~q3k/bigbrain/main.html. It's really good at figuring out the digit 2, and gets somewhat confused about other digits. Be kind to it.

Goals

  1. Be a weekend project
  2. Implement everything specific to ML/DL/NN from scratch
  3. End up with a janky JS/WASM demo

Non-Goals

  1. Be fast
  2. Be good
  3. Be clean code

Training

First, acquire the MNIST handwritten digit database (training/test sets, both images and labels) and save them in this repo.

Then, cargo run --release to run training, which will generate a net.pb containing the trained model.

Building web app

You'll need wasm-pack (cargo install wasm-pack). Then:

    cd bigbrainjs
    wasm-pack build --release --target web

You can then serve files from the bigbrainjs/web repository to see the web interface. The simplest way to do that is probably to run python -m http.server.

License

Copyright © 2021-2023 Serge Bazanski q3k@q3k.org

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.