-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
梁
authored and
梁
committed
Jan 18, 2020
0 parents
commit d340f4e
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Federated Learning | ||
|
||
This is partly the reproduction of the paper of [Communication-Efficient Learning of Deep Networks from Decentralized Data](https://arxiv.org/abs/1602.05629) | ||
Only experiments on MNIST and CIFAR10 (both IID and non-IID) is produced by far. | ||
|
||
Note: The scripts will be slow without the implementation of parallel computing. | ||
|
||
## Run | ||
|
||
The MLP and CNN models are produced by: | ||
> python [main_nn.py](main_nn.py) | ||
The testing accuracy of MLP on MINST: 92.14% (10 epochs training) with the learning rate of 0.01. | ||
The testing accuracy of CNN on MINST: 98.37% (10 epochs training) with the learning rate of 0.01. | ||
|
||
Federated learning with MLP and CNN is produced by: | ||
> python [main_fed.py](main_fed.py) | ||
See the arguments in [options.py](utils/options.py). | ||
|
||
For example: | ||
> python main_fed.py --dataset mnist --num_channels 1 --model cnn --epochs 50 --gpu 0 | ||
|
||
## Results | ||
### MNIST | ||
Results are shown in Table 1 and Table 2, with the parameters C=0.1, B=10, E=5. | ||
|
||
Table 1. results of 10 epochs training with the learning rate of 0.01 | ||
|
||
| Model | Acc. of IID | Acc. of Non-IID| | ||
| ----- | ----- | ---- | | ||
| FedAVG-MLP| 85.66% | 72.08% | | ||
| FedAVG-CNN| 95.00% | 74.92% | | ||
|
||
Table 2. results of 50 epochs training with the learning rate of 0.01 | ||
|
||
| Model | Acc. of IID | Acc. of Non-IID| | ||
| ----- | ----- | ---- | | ||
| FedAVG-MLP| 84.42% | 88.17% | | ||
| FedAVG-CNN| 98.17% | 89.92% | | ||
|
||
|
||
## Requirements | ||
python 3.6 | ||
|
||
pytorch 0.4 | ||
# LG-FedAvg | ||
# LG-FedAvg |