zkp-gravity / 0g-halo2

Proof of inference of Weightless Neural Networks using Halo2
MIT License
6 stars 0 forks source link

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:

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.