Skip to content

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.

License

Notifications You must be signed in to change notification settings

DeltaML/data-owner

Repository files navigation

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

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

Run

Using command line

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

Using Docker

Select LOCAL_PORT number to run some containers

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

Using Pycharm

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

Usage

Upload file

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

Process weights

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

Gradient step

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

Get Model from data owner

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

Data Owner configuration

N_SEGMENTS = 5
FEDERATED_AGGREGATOR_HOST = "http://cte_federated_aggregator:8080"
ETA = 1.5
REGISTRATION_ENABLE = True
ACTIVE_ENCRYPTION = False

Configuration details

  • N_SEGMENTS: TODO
  • FEDERATED_AGGREGATOR_HOST: TODO
  • ETA: TODO
  • REGISTRATION_ENABLE: TODO
  • ACTIVE_ENCRYPTION: 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

About

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.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors