Skip to content

zhengzangw/Fed-SINGA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

230311d · Nov 10, 2021

History

36 Commits
Oct 13, 2021
Oct 17, 2021
Oct 17, 2021
Nov 3, 2021
Nov 4, 2021
Nov 8, 2021
Nov 4, 2021
Oct 9, 2021
Nov 4, 2021
Nov 3, 2021
Oct 9, 2021
Nov 10, 2021
Nov 4, 2021
Nov 4, 2021
Nov 4, 2021
Nov 4, 2021
Nov 8, 2021

Repository files navigation


Fed-SINGA

SINGA

license

Description

A Federated Learning Framework using Apache SINGA.

This framework provides a codebase for developing federated learning algorithm with Apache SINGA Deep Learning Framework. Fed-SINGA simulates the real world setting by a server-client structure, where each can be placed in a docker container.

The baseline method implements Fed-Avg algorithm and Secure Aggregation.

How to run

Install dependencies

pip install -r requirements.txt

Prepare the data

# mnist
python -m src.client.data.download_mnist

# bank
# 1. download the data manually from https://archive.ics.uci.edu/ml/datasets/bank+marketing
# 2. put it under the /data folder
# 3. run the following command which:
#    (1) splits the dataset into N subsets
#    (2) splits each subsets into train set and test set (8:2)
python -m src.client.data.bank N

Training the model

# Server and clients in host machine
bash run.sh

# Server and clients in docker containers
docker-compose -f scripts/docker-compose.train_10.yml up

Generate the docker training scripts

python scripts/compose_setup.py -c 10 --mode train

Unit Test

Unit tests and smoke tests are provided to ensure the correctness of the implementation. Run following commands to check.

pytest --cov=src tests/

Contribution

See How-to-Contribute

About

Federated Learning Framework using Apache SINGA

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published