Skip to content

Proof of inference of Weightless Neural Networks using Halo2

License

Notifications You must be signed in to change notification settings

zkp-gravity/0g-halo2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zero_g - Proof of inference of Weightless Neural Networks using Halo2

In this project, we're developing a Halo2 implementation of the Zero Gravity project as part of a grant from the Ethereum Foundation.

Setup

To get started:

  • Install Rust
  • Install version 1.12.2 of HDF5
  • For EVM commands: Install version 0.8.17 of solc: (hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.17
  • For EVM commands: Install Anvil
  • Run the tests: cargo test
  • Run the benchmarks: cargo bench
  • Build the binaries: cargo build --release

Two models trained on MNIST are checked-in and located in models. To add your own models, follow the steps from the BTHOWeN-zero-g readme to train a model, convert it to HDF5 and optionally export the MNIST dataset to data/MNIST/png/.

Command-line tool

You can install the command line tool by running cargo install --path .. Then, run zero_g --help for documentation of the tool. For examples on how to use it, see test_cli.sh.

Using zero_g as a library

If you want to verify WNN predictions in your own circuit, you can do so by using the WnnChip implemented in the zero_g crate. Run cargo doc --open to open up the documentation, and see tests/using_zero_g_as_a_library.rs for an example.

About

Proof of inference of Weightless Neural Networks using Halo2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published