Practical One-Shot Federated Learning for Cross-Silo Setting

May 21, 2021 ยท View on GitHub

This is the code for paper "Practical One-Shot Federated Learning for Cross-Silo Setting" [PDF].

Dependencies

  • PyTorch 1.6.0
  • torchvision 0.2.2
  • pandas 0.24.2
  • xgboost 1.0.2
  • scikit-learn 0.22.1
  • numpy 1.18.1
  • scipy 1.4.1
  • requests 0.23.0

Sample Scripts

FedKT on MNIST using a CNN with heterogenous partition and 10 parties: sh mnist_fedkt.sh.

FedKT on SVHN using a CNN with heterogenous partition and 10 parties: sh svhn_fedkt.sh.

Parameters

ParameterDescription
modelThe model architecture. Options: tree (random forest), gbdt_tree, mlp, simple-cnn, vgg-9 .
algThe training algorithm. Options: fedkt, fedavg, fedprox, scaffold, local_training, pate
datasetDataset to use. Options: a9a, cod-rna, mnist, celeba.
lrLearning rate for the local models.
stu_lrLearning rate for the student models and the final model of FedKT.
batch-sizeBatch size.
epochsNumber of local training epochs for FedAvg and FedProx.
stu_epochsNumber of training epochs for the models in FedKT.
n_partiesNumber of parties.
n_partitionThe number of partition in each party for FedKT.
n_teacher_each_partitionThe number of teacher models in each partition for FedKT.
comm_roundNumber of communication rounds to use in FedAvg and FedProx.
betaThe concentration parameter of the Dirichlet distribution for heterogeneous partition.
muThe proximal term parameter for FedProx.
gammaThe privacy parameter for FedKT-L1 and FedKT-L2.
dp_levelset to 1 to run FedKT-L1 and 2 to run FedKT-L2.
max_tree_depthThe tree depth for random forest and gbdt.
n_stu_treesThe number of trees for random forest and gbdt.
datadirThe path of the dataset.
logdirThe path to store the logs.
deviceSpecify the device to run the program.
seedThe initial seed.