Giter VIP home page Giter VIP logo

federated-learning-knowledge-distillation's Introduction

Federated-Learning-Knowledge-Distillation

repo in several methods FedAvg, FedMD, FedProto, FedProx, FedHKD.

Code structure

  • main.py //For training the model
  • models.py //Our VAEs model for FMNIST, CIFAR10/100
  • sampling.py // functions that generate non-iid datasets for federated learning
  • utils.py // define functions that compute accuracy, soft prediction and model averaging
  • mem_utils.py // Library for monitoring memory usage and training time
  • option.py // define hyper-parameters
  • Server/*.py // object definition for server in each method
  • Client/*.py // object definition for client in each method

Parameters

  • --dataset: 'CIFAR10', 'CIFAR100', ' SVHN'
  • --batch_size: 64 by defalut
  • --num_epochs: number of global rounds, 50 by defalut
  • --lr: learning rate, 0.001 by defalut
  • --lr_sh_rate: period of learning rate decay, 10 by defalut
  • --dropout_rate: drop out rate for each layer, 0.2 by defalut
  • --clip_grad: maximum norm for gradient
  • --num_users: number of clients, 10 by defalut
  • --sampling_rate: proportion of clients send updates per round, 1 by defalut
  • --local_ep: local epoch, 5 by defalut
  • --beta: concentration parameter for Dirichlet distribution: 0.5 by defalut
  • --seed: random seed(for better reproducting experiments): 0 by defalut
  • --std: standard deviation by Differential Noise, 2 by defalut
  • --code_len: length of latent vector, 32 by defalut
  • --alg: 'FedAvg, FedProx, Moon, FedMD, Fedproto, FedHKD'
  • --eval_only: only ouput the testing accuracy during training and the running time
  • --part: percentage of each local data
  • --temp: temperture for soft prediction
  • --lam: hyper-parameter for loss2
  • --gamma: hyper-parameter for loss3
  • --model: CNN resnet18 shufflenet
  • --save_model: save checkpoints of the model

Running the code for training and evaluation

python main.py

federated-learning-knowledge-distillation's People

Contributors

citychan avatar lunan0320 avatar

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.