• Stars
    star
    198
  • Rank 196,898 (Top 4 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Decentralized Machine Learning Client

PySonar

Decentralized Machine Learning Client

Chat on Slack Build Status

Sonar is a smart contract library that allows data scientists to publish new models they want to get trained into the ModelRepository and people to pick models they can train on their personal data.

You can find a working proof of concept in the notebooks directory.

Setup

Using Docker

Using Docker is the easiest way to get this running.

  1. Run docker-compose up. This will launch IPFS, the in-memory fake ethereum blockchain with the smart contract, OpenMined mine.js and the jupyter notebooks
  2. Open the the Jupyter notebooks on http://localhost:8888
  3. Step through the notebook and check the output of the previous docker-compose up to get some infos on what happens

Usage

Bootstrap environment

Before running the demo there are a couple of prerequisites you need to install.

Base libraries

Before installing the python packages you need to make sure your system holds a set of basic math libraries required for the encryption operations (phe lib)

  • mpc: arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result
  • mpfr: multiple-precision floating-point computations
  • gmp: GNU multiple precision arithmetic library
  • npm: NPM Package Manager

For MacOS with brew just run:

brew install libmpc mpfr gmp

For Linux run:

apt-get install libgmp3-dev libmpfr-dev libmpc-dev python3-dev

Then run:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
nvm install v8

Solidity

The solidity tools are required to compile the contract of our demo. See installing solidity for instructions for your platform.

Truffle

In order to import ABIs you'll need to install truffle.

sudo npm install -g truffle

IPFS

As the network itself is too big to actually host it on the blockchain you need IPFS to host the files. For installation see the ipfs installation page or run:

brew install ipfs

After installation is complete run ipfs init to initialize your local IPFS system.

PIP packages

Make sure you have a clean python3 install and continue with installing all the packages

pip install -r requirements.txt

PIP package maintenance

PySonar utilizes pip-tools to help with maintaining PIP packages (https://github.com/jazzband/pip-tools)

To update all packages, periodically re-run

pip-compile --upgrade

Build local libraries

First you need to get sonar package bundled up

python setup.py install

Then make sure you also have the syft package properly installed. Head over to the repository and follow its instructions.

Import Smart Contract ABI

The interface for our Sonar smart contract is distributed via an npm package. You can import the ModelRepository.abi file to your local environment by running

make import-abi

which will place the file at abis/ModelRepository.abi.

Start

After you made sure all the installation steps are done you need to set up your local mock environment.

# start the ipfs daemon in the background
ipfs daemon&
# run local ethereum mock
testrpc -a 1000

Now open a second shell, start the notebook and follow its instructions

jupyter notebook notebooks

Known issues

  • there have been reports of the brew installation of solidity not working properly

If you experience any problems while running this demo please create a github issue and help us get better.

License

Apache-2.0 by OpenMined contributors

More Repositories

1

Grokking-Deep-Learning

this repository accompanies the book "Grokking Deep Learning"
Jupyter Notebook
7,339
star
2

DEPRECATED

DEPRECATED - do not use!!!
349
star
3

OM-Welcome-Package

Everything you need to know to contribute to OpenMined!
216
star
4

iamtrask.github.io

JavaScript
146
star
5

Sonar

DEPRECATED - Decentralized Machine Learning Server (hosted on Blockchain)
JavaScript
141
star
6

mine.js

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
JavaScript
33
star
7

Capsule

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
Jupyter Notebook
33
star
8

PyBV

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
Python
33
star
9

PyYashe

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
Python
20
star
10

quandl-java

This is a java api for the quandl dataservice.
Java
16
star
11

PyAono

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
C++
16
star
12

Team-Map

Map of OpenMined Contributors
JavaScript
12
star
13

openmined.org

DEPRECATED- see https://github.com/OpenMined/openmined-website
CSS
10
star
14

quantus

Distributed CPU/GPU Basic Linear Algebra Service (Blas)
Python
7
star
15

mine-ui

MineUI React application to interface with mine.js
JavaScript
6
star
16

PrincipiaMathematica

5
star
17

syft-translator.js

DEPRECATED- see https://github.com/OpenMined/OpenMined or https://github.com/OpenMined/PySyft
JavaScript
5
star
18

BootstrapNodes

4
star
19

Bygone

A centralized service with a goal of becoming obsolete.
JavaScript
4
star
20

NALU-pytorch

A PyTorch Implementation of "Neural Arithmetic Logic Units"
Python
2
star
21

quandl-scala

This is a scala API for the Quandl Dataservice
Java
2
star
22

R-Homomorphic-Encryption-Package

This is a fork of the R HomomorphicEncryption package originally from http://www.louisaslett.com/HomomorphicEncryption/
R
2
star
23

tether

Go
1
star