Code Monkey home page Code Monkey logo

upcycled-fl's Introduction

Federated Learning with Reduced Information Leakage and Computation

This repo contains PyTorch implementation of Upcycled-FL. Upcycled-FL is a simple yet effective strategy that applies first-order approximation at every even round to reduce the data accesses and improve the privacy guarantees. For more details, please check our paper Federated Learning with Reduced Information Leakage and Computation.

Usage

We have included all the baselines used in the paper within this repository.

To run the code:

python -u train.py --baseline <baseline_name> --algorithm <Upcycled or Vanilla> --seed <random_seed> --dataset <dataset_name>  --epochs <number_epochs> --frac <fraction of devices> --local_ep <number_epoch_clients> --lr <learning_rate> --upcycled_param <even_step_upcycled_parameter> --clip <output_perturbation_parameter> --sigma <output_perturbation_parameter> --alpha <objective_perturbation_parameter> --local_bs <batch_size> --straggler <straggler_ratio> --gpu <gpu_id> |  tee <your_log_path>

Taking Upcycled-FedAvg as an example:

Non-private

To compare convergence, we conduct experiments under the similar training time.

python -u train.py --baseline avg --algorithm Upcycled --seed 2 --dataset synthetic_0.5_0.5  --epochs 160 --frac 0.3 --local_ep 10 --lr 5e-3 --upcycled_param 0.7 --clip 0 --sigma 0 --alpha 0 --local_bs 32 --straggler 0.3 --gpu 0 
python -u train.py --baseline avg --algorithm Vanilla --seed 2 --dataset synthetic_0.5_0.5  --epochs 80 --frac 0.3 --local_ep 10 --lr 5e-3 --upcycled_param 0 --clip 0 --sigma 0 --alpha 0 --local_bs 32 --straggler 0.3 --gpu 0 

Output Perturbation

python -u train.py --baseline avg --algorithm Upcycled --seed 2 --dataset synthetic_0.5_0.5  --epochs 80 --frac 1 --local_ep 10 --lr 7e-2 --upcycled_param 0.3 --clip 10 --sigma 0.8 --alpha 0 --local_bs 32 --gpu 0 
python -u train.py --baseline avg --algorithm Vanilla --seed 2 --dataset synthetic_0.5_0.5  --epochs 80 --frac 1 --local_ep 10 --lr 7e-2 --upcycled_param 0 --clip 10 --sigma 1 --alpha 0 --local_bs 32  --gpu 0 

We provide clip and sigma configuration in train.py to guarentee stricter privacy for Upcycled-FL.

Objective Perturbation

python -u train.py --baseline avg --algorithm Upcycled --seed 2 --dataset synthetic_0.5_0.5  --epochs 80 --frac 1 --local_ep 10 --lr 1e-3 --upcycled_param 0.7 --clip 0 --sigma 0 --alpha 20 --local_bs 32 --gpu 0 
python -u train.py --baseline avg --algorithm Vanilla --seed 2 --dataset synthetic_0.5_0.5  --epochs 80 --frac 1 --local_ep 10 --lr 1e-3 --upcycled_param 0 --clip 0 --sigma 0 --alpha 10 --local_bs 32  --gpu 0 

For objective Perturbation, please keep clip and sigma as 0.

Citing

@article{
yin2024federated,
title={Federated Learning with Reduced Information Leakage and Computation},
author={Tongxin Yin and Xuwei Tan and Xueru Zhang and Mohammad Mahdi Khalili and Mingyan Liu},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2024},
url={https://openreview.net/forum?id=ZJ4A3xhADV}
}

Contact

If you have any questions, you can contact me via email at [email protected]. You can also open an issue here, but please note that this repo is managed by a public account, so I might not see it immediately.

Acknowledgement

Our code is based on existing FL repos. We sincerely appreciate the following github repos:

https://github.com/litian96/FedProx

https://github.com/KarhouTam/FL-bench

https://github.com/DataSysTech/FedTune

upcycled-fl's People

Contributors

carco-git avatar osu-srml 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.