|
Algorithm 1 FedAvg: federated averaging algorithm. |
-
1:
Input: Number of rounds T, number of clients K, learning rate
-
2:
Initialize global model weights
-
3:
for each round do
-
4:
Sample a subset of K clients
-
5:
for each client in parallel do
-
6:
Download global model weights
-
7:
Compute local model weights by performing E epochs of SGD on local data
-
8:
end for
-
9:
Aggregate local models:
-
10:
end for
-
11:
Return: final global model weights
|