Skip to main content
. 2020 Jul 21;20(14):4048. doi: 10.3390/s20144048
Algorithm 1 FedMed. p is the size of workers for training, E is the size of local epochs; the U workers are indexed by u, and S indicates the choice of adaptive aggregation or FedAvg.
1: procedure SERVERUPDATE:
2:    Initialize w0
3:    for each round k=1,2, do
4:        p max (1,C·K)
5:        Uk (random p workers)
6:        for each worker uUk in parallel do
7:           wt+1u WorkerUpdate (u,wt)
8:        end for
9:        //Implement mediation incentive scheme
10:        Δ alteration of two losses
11:        SSe(Δ)
12:        if S is 1 then
13:           wt+1Adaptive aggregation
14:         else
15:           wt+1Σu=1pnunwt+1u
16:        end if
17:    end for
18: end procedure
19: procedure WorkerUpdate(u,w)
20:    //Run on worker u
21:    B (split data Pu into batches size of B)
22:    for each local epoch i from 1 to E do
23:        for batch bB do
24:           wwηL(w)
25:        end for
26:    end for
27:     return w to server
28: end procedure