Giter Club home page Giter Club logo

fedcoin's Introduction

FedCoin

A Peer-to-Peer Payment System for Federated Learning

Layered Architecture

  • Data (Transaction, Block, ChainStructure, etc.)
  • Network (Message, P2P, etc.)
  • Consensus (Consensus, PoSap, etc.)
  • Incentive
  • Contract
  • Application (Application, FedCoin, etc.)

Usage

Prepare

To build and run FedCoin, you must ensure the following software or package(s) are installed in your experimental computer(s):

Moreover, Linux distribution like Ubuntu 16.04.7 LTS is recommended as the operating system. Anaconda (Mirror: TUNA) is recommended as the environment manager. Run the conda create -n fedcoin python=3.5 tensorflow-gpu command, and the python -m pip install docker command in new created fedcoin environment could easily get a basic running environment.

Generate weights

Run the following codes in the Python environment to generate weights:

from blockchain.application.fedcoin import FedCoin
FedCoin.run_fl_server()

Set parameters

Parameters are defined in blockchain/util/settings.py, which are showed as follows:

Parameter Description Type Range Default
K Number of FL clients int [2, inf] 20
R Number of replicas (miners) int [2, inf] 2
D Difficulty in mining float [0.0, inf] 1.5
PRICE Amount of FedCoins as rewards float [0.0, inf] 1000.0
RUNTIME Time to mine in a round float [0.0, inf] 15.0
TRAIN_PRICE Payments to the FL clients float [0.0, 1.0] 0.7
COM_PRICE Payments to the FL server for processing the model aggregation float [0.0, 1.0] 0.1
SAP_PRICE Payments yo the blockchain network miners for calculating SV float [0.0, 1.0] 0.2

Note: The condition "TRAIN_PRICE + COM_PRICE + SAP_PRICE = 1" should be satisfied.

Build and run

The shell code python main.py will build fedcoin and fedcoin_lw images, and run several fedcoin containers that matches the number of replicas defined in settings.

Run docker run fedcoin_lw will start publishing tasks.

The batch file clean.sh will stop and delete containers, as well as delete images that are untagged.

References

  • Yuan Liu, Zhengpeng Ai, Shuai Sun, Shuangfeng Zhang, Zelei Liu, Han Yu. FedCoin: A Peer-to-Peer Payment System for Federated Learning. In Book "Federated Learning: Privacy and Incentive" (DOI:10.1007/978-3-030-63076-8_9)
  • Yuan Liu, Shuai Sun, Zhengpeng Ai, Shuangfeng Zhang, Zelei Liu, Han Yu. FedCoin: A Peer-to-Peer Payment System for Federated Learning. In arXiv (arXiv:2002.11711)

fedcoin's People

Contributors

neuai 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.