
1、 安装环境依赖;
2、 以人工手写数字图片数据集MNIST为例,运行以下命令对数据集进行划分:
python generate_fedtask.py --dataset mnist --dist 0 --skew 0 --num_clients 100
使用默认的训练参数快速得到FedAvg算法在MNIST数据集上的训练结果,结果将存储在 ./fedtask/mnist_cnum100_dist0_skew0_seed0/record/:
pythonmain
-task mnist_cnum100_dist0_skew0_seed0
--model cnn
--algorithm fedavg
--num_rounds 20
--num_epochs 5
--learning_rate 0.215
--proportion 0.1
--batch_size 10
--eval_interval 1
3、 使用以下命令可视化结果:
python result_analysis.py
使用教程
Use the tutorial