项目作者: DeltaML

项目描述 :
Participant in Federated Learning scheme that can take the role of training a local instance of model or calculate the error of the federated model using local data.
高级语言: Python
项目地址: git://github.com/DeltaML/data-owner.git
创建时间: 2019-07-04T00:40:57Z
项目社区:https://github.com/DeltaML/data-owner

开源协议:MIT License

下载


Federated learning - Data Owner

Build Status
Coverage Status

Participant in Federated Learning scheme that can take the role of training a local instance of model or calculate the error of the federated model using local data.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Installing

A step by step series that tell you how to get a development env running

  1. git clone git@github.com:DeltaML/federated-learning-poc.git
  2. cd federated-learning-poc/
  3. python3 -m venv venv
  4. source venv/bin/activate
  5. pip install -r data_owner/requirements.txt

Run

Using command line

  1. gunicorn -b "0.0.0.0:8080" --chdir data_owner/ wsgi:app --preload

Using Docker

Select LOCAL_PORT number to run some containers

  1. docker build -t federated-learning-data_owner --rm -f data_owner/Dockerfile .
  2. docker run --rm -it -p <LOCAL_PORT>:5000 federated-learning-data_owner
  1. docker run --rm -it -p 5001:5000 4001:4000 federated-learning-data_owner

Using Pycharm

  1. Script Path: .../data_owner/virtualenv/bin/gunicorn
  2. Parameters: -b "0.0.0.0:5000" wsgi:app --preload
  3. Working directory: ../data_owner

Usage

Upload file

  1. curl -v -F data=/data_owner/dataset/file_1.csv "http://localhost:5000/weights"
  2. curl -v -X POST file=@"data_owner/dataset/file_1.csv" http://localhost:5000/datasets

Process weights

  1. curl -v -H "Content-Type: application/json" -X POST -d '{"type": "LINEAR_REGRESSION", "public_key": "XXXXXXXXXXXXXXXX"}' "http://localhost:5000/weights"

Gradient step

  1. curl -v -H "Content-Type: application/json" -X POST -d '{"gradient":[{"w1":1}]}' "http://localhost:9090/step"

Get Model from data owner

  1. curl -v -H "Content-Type: application/json" -X GET "http://localhost:9090/model"

Data Owner configuration

  1. N_SEGMENTS = 5
  2. FEDERATED_AGGREGATOR_HOST = "http://cte_federated_aggregator:8080"
  3. ETA = 1.5
  4. REGISTRATION_ENABLE = True
  5. ACTIVE_ENCRYPTION = False

Configuration details

  • NSEGMENTS: _TODO
  • FEDERATEDAGGREGATORHOST: __TODO
  • ETA: TODO
  • REGISTRATIONENABLE: _TODO
  • ACTIVEENCRYPTION: _TODO

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details