Skip to content

Simulate the fedavg and fedprox algorithm of federated learning

Notifications You must be signed in to change notification settings

Turningl/fedavg_pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Federated Learning With Opacus (PyTorch)

In this repository, I used PyTorch and Opacus to simulate the fedavg and fedprox algorithm of federated learning. And add differential privacy in the models.

Requirments

  • python == 3.8.0
  • pytorch == 1.12.1
  • torchvision == 0.13.1
  • opacus == 1.4.0
  • numpy == 1.23.2
  • matplotlib == 3.2.0
  • scikit-learn == 1.2.2

Running the experiments

  • Running fedavg algorithm with differential privacy
python main.py --dp True
  • Running fedprox algorithm with differential privacy
python main.py --dp True --fedprox True

Advantage

Compared to the fedavg done by others, my model is more featured, you can see my code.

About

Simulate the fedavg and fedprox algorithm of federated learning

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages