Server executes:
  initialize w0
  for round t = 1, 2, 3, ...:
    m = max(C * K, 1)         # clients this round
    S_t = random subset of m clients
    for client k in S_t (in parallel):
      w_k = ClientUpdate(k, w_t)
    w_(t+1) = sum_k (n_k / n) * w_k   # weighted avg

ClientUpdate(k, w):           # runs locally on client k
  batches = split local data into size-B batches
  for local epoch i = 1 ... E:
    for batch b in batches:
      w = w - eta * gradient(loss(w; b))
  return w
