MPC-learning is a Python library for performing multi-party computation on machine learning applications. This library implements the 3-party computation protocol of https://eprint.iacr.org/2016/768.pdf . For now, a "dealer" is required to distribute shares of inputs, and the protocol can only be run locally (does not support networking yet).
This is a quick guide to getting this repo up and running for development.
Clone the library
$ git clone https://github.com/trailofbits/mpc-learning
Create and source your virtual environment.
$ virtualenv -p python3 .venv $ source .venv/bin/activate
Install the library:
a. if you want to use and edit the library:
$ python setup.py develop
b. otherwise to just use the library:
$ python setup.py install
If everything installed correctly the following examples should work:
raw perceptron algorithm:
$ python examples/perceptron/alg.py
mpc perceptron (should be same result as raw algorithm, but will take longer):
$ python examples/perceptron/eval_circuit.py
raw svm algorithm:
$ python examples/svm/alg.py
mpc svm (should be same result as raw algorithm, but will take longer):
$ python examples/svm/eval_circuit.py
If you would like to run this library on a different algorithm, you will have to synthesize the corresponding circuit for one iteration of the algorithm. The circuits must be in the correct format. For reference, checkout the perceptron and svm circuits: examples/*/circuit.py
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.