GithubHelp home page GithubHelp logo

hierarchical-sgd's Introduction

Hierarchical Federated Learning

This is the code for the paper entitled "Demystifying Why Local Aggregation Helps: Convergence Analysis of Hierarchical SGD", by Jiayi Wang, Shiqiang Wang, Rong-Rong Chen, Mingyue Ji.

Data and Model

Dataset includes Cifar-10 and MNIST with IID and Non-IID options. It also includes FEMNIST and CelebA obtained from the LEAF framework (https://github.com/TalwalkarLab/leaf/tree/master/data) stored in the dataset_files folder. For CelebA, the raw images need to be downloaded separately (see https://github.com/jia-yi-wang/aistats21/blob/main/data_reader/celeba.py#L23 for details).

Default net is VGG-11 without pretraining.

Requirement

Pytorch 1.6.0

Python 3.7

Run

See the arguments in options.py.

The following are examples of running our code.

For two-level case,

python main_fed.py --epochs 1000 --gpu 0 --num_groups 2 --local_period 10 --group_freq 5 --frac 0.2

For three-level case,

python three_level_main_fed.py --epochs 1000 --gpu 0 --num_groups 2 --local_period 10 --group_freq 5 --frac 0.2 --num_teams 5 --team_epochs 5

Third party library

This code partly reuses code from the following repository:
https://github.com/shaoxiongji/federated-learning

hierarchical-sgd's People

Contributors

jia-yi-wang avatar c3atuofu avatar

Stargazers

Li Yipeng avatar Tim Gu avatar Heqiang Wang avatar fushucun avatar

Watchers

 avatar

Forkers

frontop137

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.