Giter Club home page Giter Club logo

federated-pytorch-test's Introduction

federated-pytorch-test

We train CNN models without having access to the full dataset. The CIFAR10 dataset is used in all examples. The CNN models can be chosen from simpler models similar to PyTorch or Tensorflow demos and also ResNet18. In all cases, we use only 1/K (where K is user defined) of the data for training each CNN model. We also compare the performance of federated averaging and consensus optimization in training the K models, without sharing the training data between models. Note that we only pass a subset of parameters between the models, unlike in normal federated averaging or consensus. This reduces the bandwidth required enormously!

The stochastic LBFGS optimizer is provided with the code. Further details are given in this paper. Also see this introduction.

GPU acceleration is enabled when available, set use_cuda=True. Files included are:

lbfgsnew.py: New LBFGS optimizer

simple_models.py: Relatively simple CNN models for CIFAR10, derived from PyTorch/Tensorflow demos, also ResNet18

no_consensus_multi.py: Train K models using 1/K of the training data for each model

federated_multi.py: Train K models using 1/K of the data, with federated averaging, K can be varied

fedprox_multi.py: Train K models using 1/K of the data, with federated proximal algorithm, K can be varied, based on this paper

consensus_multi.py: Train K models using 1/K of the data, with consensus optimization (adaptive) ADMM, K can be varied

federated_vae.py: Train K variational autoencoders, using federated averaging

federated_vae_cl.py: Train K variational autoencoders for clustering, using federated averaging, based on this paper

federated_cpc.py: Train K models using contrastive predictive coding, using LOFAR data, based on this paper

test accuracy for training K=10 models

This images compares training K=1 and K=10 models, stad alone training using no_consensus_multi.py, with consensus optimization consensus_multi.py and with federated averaging federated_multi.py. The upper bound is using the full dataset for training ( K=1 ) while using 1/K of the data gives the lower bound.

federated-pytorch-test's People

Contributors

sarodyatawatta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

federated-pytorch-test's Issues

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.