Giter VIP home page Giter VIP logo

fedigw's Introduction

FedIGW

This repository is the official implementation of the algorithm FedIGW for the paper Harnessing the Power of Federated Learning in Federated Contextual Bandits, which will be published in TMLR soon.

Requirements

To install requirements:

pip install -r requirements.txt

For the baseline AGR, we adopted some implementation from the github repo contextualbandits and the slightly revised code is placed in /src/baseline folder, which can be directly used.

For the baseline FN-UCB, we directly utilized the code from the authors of Federated Neural Bandits please clone the code from repo and substitute some of the training scripts use the code in ./src/FNB. To run the experiment, follow the instruction of that repo.

Before running the script, you need to change the path config in env.py:

dataset_path = "/path/to/your/dataset"

Training

To train the model(s) in the paper, run this command:

python ./src/main.py

For the server definition, you can control whether using 'Bibtex' or 'Delicious'. For reward function, we support 'MLP' and 'CNN'. Client number here stands for the total number of clients, we support 'FedAvg', 'FedProx' and 'Scaffold' as our fl structure right now.

FL_Server(env_name = "Bibtex",  reward_function = "MLP", client_num = 10, gamma = 7000, fl_method = "FedProx")

For the training steps: comm_rounds stands for how often the clients will sync with the server. The local step stands for how many local training steps the client will take for each local training round, 0 will follow a default exponential growing strategy with largest step of 4096. Client number here stands for how many client will join the communication each communication round.

train(comm_round = 1, local_steps = 0 , total_rounds = 100, client_num = 10)

Results

After running the training script, you can then plot the figures similar to our paper following the jupyter notebook, notice that before drawing to results, you need to specify the path you where you log your results:

result_path = "/path/to/your/result"

fedigw's People

Contributors

shengroup avatar kuny1240 avatar

Watchers

 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.