zero_g
- Proof of inference of Weightless Neural Networks using Halo2In this project, we're developing a Halo2 implementation of the Zero Gravity project as part of a grant from the Ethereum Foundation.
To get started:
solc
:
(hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.17
cargo test
cargo bench
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/
.
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
.
zero_g
as a libraryIf 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.