Skip to content
Perform multi-party computation on machine learning applications
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


MPC-learning is a Python library for performing multi-party computation on machine learning applications. This library implements the 3-party computation protocol of . 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.

  1. Clone the library

    $ git clone
  2. Download virtualenv.

  3. Create and source your virtual environment.

    $ virtualenv -p python3 .venv
    $ source .venv/bin/activate
  4. Install the library:

    a. if you want to use and edit the library:

    $ python develop

    b. otherwise to just use the library:

    $ python install


If everything installed correctly the following examples should work:

  1. raw perceptron algorithm:

    $ python examples/perceptron/
  2. mpc perceptron (should be same result as raw algorithm, but will take longer):

    $ python examples/perceptron/
  3. raw svm algorithm:

    $ python examples/svm/
  4. mpc svm (should be same result as raw algorithm, but will take longer):

    $ python examples/svm/

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/*/


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.


Apache 2.0

You can’t perform that action at this time.