FedAVG算法
- 初始化权重 w 0 w_0 w0;
- 进行第 t t t轮模型融合,从所有客户端中随机选取 S t S_t St个客户端;
- 基于 w 0 w_0 w0在每个客户端上进行训练,得到新模型 w t + 1 k w_{t + 1}^k wt+1k;
- 对
k
k
k个模型取平均得到
w
t
+
1
w_{t+1}
wt+1;
重复2~4操作,进行下一轮模型聚合;
E: the number of training passes each client makes over its local dataset on each round
两次联邦训练之间的本地训练的次数
C: the fraction of clients that perform computation on each round
每次参与联邦聚合的clients数量占client总数的比例。C=1 代表所有成员参与聚合
batch_size: the local minibatch size used for the client updates.
client的本地的训练的batchsize
C=E=1 ,batch_size=∞时,FedAvg等价于FedSGD,FedSGD是特殊形式的FedAVG。
FedSGD传梯度,FedAvg传参数。