Jason Morton 2c8a9e3eb8 Merge pull request #6 from jasonmorton/ac/clippy-chore
chore: remove clippy warnings
2022-08-28 11:49:16 -04:00
2022-07-22 11:24:54 -04:00
2022-08-28 04:00:45 +02:00
2022-08-24 22:18:52 -04:00
2022-08-15 09:44:25 -04:00
2022-08-28 17:09:11 +02:00

Halo2 Deep Learning

Test

This is a proof-of-concept implementation of inference for deep learning models in a zk-snark using Halo2. 2d convolution, fully connected (affine) layers, and nonlinearities such as ReLU and sigmoid are implemented. The input image and model parameters are provided as private advice and the last layer is the public input (instance column). Other configurations are also possible.

See here for an example that uses this crate as a library.

We give an example of proving inference with a model that achieves 97.5% accuracy on MNIST in the tests.

Running examples

The MNIST inference example (test_prove_mnist_inference) is by default ignored because making the proof uses a lot of memory and takes about three minutes. To run it, use

cargo test --release -- --ignored --nocapture

or ``--include-ignored` to run together with the rest.

Note that the library requires a nightly version of the rust toolchain. You can change the default toolchain by running:

rustup override set nightly         
Description
No description provided
Readme 164 MiB
Languages
Rust 96.7%
Python 2.4%
Shell 0.9%