Skip to content

tuminguyen/FedXGraph

Repository files navigation

Centrality Matters: Lightweight Graph-centric Aggregation for Moderately Heterogeneous Federated Learning

SETUP AND INSTALLATION

The work was run on

  • Python 3.8.16
  • Ubuntu 22.04

To set up the environment and install all the packages, run:

conda env create -f environment.yml

Activate the imported environment:

conda activate fxg

RUN THE PROGRAM

SOTA BASELINES

Incuding customized FedDyn, FedGraB, FedPer and FedRep.

Follow the README.md in each algorithm folder under baseline/ folder to run.

FXG & OTHER BASELINES

Including: fxg- variant, FedAvg, FedProx, GNN, Avg+GNN and Avg+Deg.

DEFAULT VALUES:

Params Type Default Value
--strategy string FedAvg
--mu float 0.1
--alpha float 0.1
--dataset string CIFAR10
--rounds int 500
--num_clients int 10
--quantile int 20
--fuse int 1

FXG VARIANTS SUMMARY:

FXG- variant Centralities (+ Anchor)
DEG Degree
EIG Eigenvector
LAP Laplacian
BIH string
EIGLAP Eigenvector + Laplacian
EIGBIH Eigenvector + Biharmonic
LAPBIH Laplacian + Biharmonic
EIGLAPBIH Eigenvector + Laplacian + Biharmonic
FULL Degree + Eigenvector + Laplacian + Biharmonic
GAF GNN

USAGE:

python main.py --strategy [aggregation strategy] 
               --mu [proximal_mu for FedProx only] 
               --alpha [dirichlet alpha] 
               --dataset [dataset name] 
               --rounds [num of communication rounds] 
               --num_clients [number of clients]
               --quantile [top % edges] 
               --fuse [1 (fuse with anchor) | 0 (pure)]

EXAMPLES:

  • FedProx (500 rounds/default) on Fashion_MNIST dataset with $\alpha=1$ and $\mu=0.01$

    python main.py --strategy FedProx --dataset Fashion_MNIST --alpha 1 --mu 0.01
    
  • FedAvg (5 rounds) on CIFAR10 dataset with $\alpha=10$

    python main.py --strategy FedAvg --rounds 5 --dataset CIFAR10 --alpha 10
    
  • Pure GNN (5 rounds) on CIFAR10 dataset with $\alpha=10$ and quantile 20% (NO fusion)

    python main.py --strategy GA --rounds 5 --dataset CIFAR10 --alpha 10 --quantile 20
    
  • GNN fused (5 rounds) on CIFAR10 dataset with with 5 clients $\alpha=0.1$ and quantile 25%

    python main.py --strategy GAF --rounds 5 --num_clients 5 --dataset CIFAR10 --alpha 0.1 --quantile 25
    
  • All four centralities fused (2 rounds) on CIFAR10 dataset with $\alpha=1$ and quantile 15%

    python main.py --strategy FULL --rounds 2 --dataset CIFAR10 --alpha 1 --quantile 15
    

Run and save output log to file using: python main.py [PARAMS CONFIGS] > [PATH_TO_RESULT_FILE] 2>&1

For helps and understand more the arguments, run: python [.PY FILE] -h

About

Graph-based weights alignment in Federated Learning aggregation

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors