Skip to main content
. 2023 Dec 25;14(1):43. doi: 10.3390/diagnostics14010043
Algorithm 1. Federated Averaging
K—number of clients from 1 to n
B—minimum batch size
E—number of epochs
F—fractions of clients
Server function—FedAvg
Initialize global weights w
for round i = 1, 2…do
  M ← max (F.K, 1)
  Vt ← (random sets of M clients)
  for client k € Vt do parallel
  ClientUpdate(k, wt)
   wt+1ΣKk=1Wkt+1
  end
end

Client function—ClientUpdate(k, w)
B ← Split data into batches
For each local epoch i from1 to E do
   Update client w
Return w to server