Coder Social home page Coder Social logo

flower_opacus's Introduction

flower_opacus

Federated learning with differential privacy using Flower and Opacus packages in Pytorch

File description:

The client[x].py files each represent a uniuqe device in the simulation. The server.py file is the centralized server to which each clients send their model parameters and metrics.

The clients_pytorch.py file contains the classes used to create the model in each client. The pytorch.py file contains the same model specifications as the federated learning, but in a centralized 'vanilla' approach. this allows for easy comparison.

The files with 'dp" in their name are the ones that apply differential privacy to the model parameters. Also here it includes one in federated setup and another for centralized approach.


server.py

the aggregated metrics: F1, accuracy, precision, recall are printed after a run is completed and after each global training round.

in differential privacy mode, also the aggregated epsilon (privacy guarantee) is printed during training


HOW TO RUN

start the server by using command python server.py run each client[x].py file from their own terminal by using command python client[x].py 8080

wait for the model to complete training and see the evaluation metrics printed in the server terminal


Requirements:

  • Python 3.7
  • Torch 1.13.1
  • Opacus 1.1.2
  • Flwr 1.5.0

flower_opacus's People

Contributors

sanderpe 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.