MIT License

项目介绍

Lee-Gihun/FedNTD 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 94 个 Star、14 次 Fork。

仓库全名
Lee-Gihun/FedNTD
开源许可证
MIT License
Star 数
94
Fork 数
14

README 摘要

FedNTD (Federated Not-True Distillation) This repository is the official PyTorch implementation of: "Preservation of Global Knowledge by Not-True Distillation in Federated Learning (NeurIPS 2022)". Our code structure is based on FedML but refactored for simplicity. We implemented various FL algorithms in our framework: FedCurv, FedAvgM, Scaffold, Fedprox, MOON, FedNova, FedDyn, and FedNTD (Ours). Requirements This…

完整内容见 GitHub 原始 README 或本页 。

常见问题

FedNTD 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 94 个 Star。

FedNTD 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 FedNTD 的源码?

可以直接克隆仓库:git clone https://github.com/Lee-Gihun/FedNTD.git,默认分支为 master;安装与运行步骤见仓库 README。

FedNTD 最近还在维护吗?

仓库最近一次更新为 2023年2月24日,当前没有未关闭的 Issue;Star 数为 94,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

(NeurIPS 2022) Official Implementation of "Preservation of the Global Knowledge by Not-True Distillation in Federated Learning"

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Python

README

FedNTD (Federated Not-True Distillation)

This repository is the official PyTorch implementation of:

“Preservation of Global Knowledge by Not-True Distillation in Federated Learning (NeurIPS 2022)”.

Our code structure is based on FedML but refactored for simplicity.

We implemented various FL algorithms in our framework:

  • FedCurv, FedAvgM, Scaffold, Fedprox, MOON, FedNova, FedDyn, and FedNTD (Ours).

Requirements

  • This codebase is written for python3 (used python 3.8.8 while implementing).
  • We use Pytorch version of 1.9.0 and 10.2, 11.0 CUDA version.
  • To install necessary python packages,
    pip install -r requirements.txt
    
  • The logs are uploaded to the wandb server. If you do not have a wandb account, just install and use as offline mode.
    pip install wandb
    wandb off
    

How to Run Codes?

The configuration skeleton for each algorithm is in ./config/*.json.

  • python ./main.py --config_path ./config/algorithm_name.json conducts the experiment with the default setups.

There are two ways to change the configurations:

  1. Change (or Write a new one) the configuration file in ./config directory with the above command.
  2. Use parser arguments to overload the configuration file.
  • --dataset_name: name of the datasets (e.g., mnist, cifar10, cifar100 or cinic10).
    • for cinic-10 datasets, the data should be downloaded first using ./data/cinic10/download.sh.
  • --n_clients: the number of total clients (default: 100).
  • --batch_size: the size of batch to be used for local training. (default: 50)
  • --partition_method: non-IID partition strategy (e.g. sharding, lda).
  • --partition_s: shard per user (only for sharding).
  • --partition_alpha: concentration parameter alpha for latent Dirichlet Allocation (only for lda).
  • --model_name: model architecture to be used (e.g., fedavg_mnist, fedavg_cifar, or mobile).
  • --n_rounds: the number of total communication rounds. (default: 200)
  • --sample_ratio: fraction of clients to be ramdonly sampled at each round (default: 0.1)
  • --local_epochs: the number of local epochs (default: 5).
  • --lr: the initial learning rate for local training (default: 0.01)
  • --momentum: the momentum for SGD (default: 0.9).
  • --wd: weight decay for optimization (default: 1e-5)
  • --algo_name: algorithm name of the experiment (e.g., fedavg, fedntd)
  • --seed: random seed

Reference Github

We refer to the following repositories:

Citing this work

@article{lee2021preservation,
  title={Preservation of the global knowledge by not-true self knowledge distillation in federated learning},
  author={Lee, Gihun and Shin, Yongjin and Jeong, Minchan and Yun, Se-Young},
  journal={arXiv preprint arXiv:2106.03097},
  year={2021}
}

评论

暂无评论