GithubHelp home page GithubHelp logo

spacecase123 / pmpl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fudanmpl/pmpl

0.0 0.0 0.0 14.41 MB

pMPL: A Robust Multi-Party Learning Framework with a Privileged Party

C++ 99.44% CMake 0.56%

pmpl's Introduction

pMPL

Introduction

pMPL is a three-party learning framework based on vector space secret sharing with the privileged setting where a party can be set as the privileged party before machine learning. Without the participation of it, assist parties have no chance to reveal the secret value even if they collude. Meanwhile, pMPL can tolerate either of assist parties dropping out during training. pMPL supports linear regression, logistic regression and neural networks.

Repository Structure

  • '3PC/': The training process if no party drops out.

  • '2PC/': The training process if one assist party drops out.

Running for 3pc

Network Configuration

In the default configuration, multiple processes run on a server, which is a LAN environment.

In order to simulate WAN environment, we can use the following command.

# simulate WAN
sudo tc qdisc add dev lo root netem delay 20ms rate 40Mbps
# cancle the simulation
sudo tc qdisc del dev lo root netem delay 20ms rate 40Mbps

pMPL/3pc/util/SocketManager.cpp line 138

```c++
void SocketManager::pMPL::init()
{
    // init("127.0.0.1", 1234);
    string ip[M] = {"127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1"}; 
    int port[M] = {12000, 12001, 12002, 12003}; 
    init(ip, port);
}

Compile

Constant.h

#define M 4
#define ML 0
  • M: the 4 shares (3 parties)
  • ML: machine learning models, 0 for linear regression; 1 for logistic regression; 2 for neural networks

Compile the executable file

cd pMPL/3pc
cmake .
make -j

Run

Start four processes and input the party index, respectively:

./pmpl_3pc 0
./pmpl_3pc 1
./pmpl_3pc 2
./pmpl_3pc 3

If one assist party drops out during the training phase, the intermediate results hold by each party will be stored in "pMPL/3pc/Result", which can be used as initialization coefficients for 2PC training.

Running for 2pc

Network Configuration

pMPL/2pc/util/SocketManager.cpp line 138

void SocketManager::pMPL::init()
{
    // init("127.0.0.1", 1234);
    string ip[M] = {"127.0.0.1", "127.0.0.1", "127.0.0.1"};
    int port[M] = {12011, 12012, 12013};
    init(ip, port);
}

Compile

Constant.h

#define M 3
#define ML 0
  • M: the 3 shares (2 parties)
  • ML: machine learning models, 0 for linear regression; 1 for logistic regression; 2 for neural networks

Compile the executable file

cd pMPL/2pc
cmake .
make -j

Run

Start three processes and input the party index, respectively:

./pmpl_3pc 0
./pmpl_3pc 1
./pmpl_3pc 2

Help

Any question, please contact [email protected].

pmpl's People

Contributors

sls33 avatar xuandragon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.