SkillAgentSearch skills...

FedAvg

This is a implemention of FedAvg in paper Communication-Efficient Learning of Deep Networks from Decentralized Data.

Install / Use

/learn @zj-jayzhang/FedAvg
About this skill

Quality Score

0/100

Supported Platforms

Zed

README

FedAvg

This is a implemention of FedAvg in paper Communication-Efficient Learning of Deep Networks from Decentralized Data.

How to run the codes?

At first, you should creat two dirs called 'logs' and 'checkpoints', then you can cd into 'src', and run FedAvg on iid cifar10 and mnist

python3 federated_main.py --model=cnn --dataset=cifar --iid=1 --epochs=300 --lr=0.01 --local_ep=5 --local_bs=32

python3 federated_main.py --model=cnn --dataset=mnist --iid=1 --epochs=100 --lr=0.01 --local_ep=5 --local_bs=32

noniid cifar10 and mnist:

python3 federated_main.py --model=cnn --dataset=cifar --iid=0 --epochs=300 --lr=0.01 --local_ep=5 --local_bs=32

python3 federated_main.py --model=cnn --dataset=mnist --iid=0 --epochs=100 --lr=0.01 --local_ep=5 --local_bs=32

For best test acc:

|- |CIFAR10 |MNIST | | ------------- | ------------- |------------ | | IID | 68.70% | 98.87% | | Non-IID | 68.11% | 98.05%|

test acc curve(for cifar10 both in iid and noniid setting):

企业微信截图_20210422101626

Related Skills

View on GitHub
GitHub Stars33
CategoryEducation
Updated4mo ago
Forks14

Languages

Python

Security Score

72/100

Audited on Dec 4, 2025

No findings