Algorithm 1 Federated Averaging. In the cluster there are N clients in total, each with a learning rate of . The set containing all clients is denoted as S, the communication interval is denoted as E, and the fraction of clients is denoted as C
|
On Server:
-
1:
Initialization: global model .
-
2:
for each global epoch do
-
3:
# Determine the number of participants.
-
4:
-
5:
# Randomly choose participants.
-
6:
-
7:
for all each client do in parallel
-
8:
# Get clients updated model.
-
9:
-
10:
end for
-
11:
# Update global model.
-
12:
-
13:
end for
OnClientUpdate
-
14:
for each client epoch do
-
15:
# Do local model training on local dataset.
-
16:
-
17:
end for
-
18:
return
|