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 indicates the choice of adaptive aggregation or FedAvg. |
1: procedure SERVERUPDATE: 2: Initialize 3: for each round do 4: max 5: (random p workers) 6: for each worker in parallel do 7: WorkerUpdate 8: end for 9: //Implement mediation incentive scheme 10: alteration of two losses 11: 12: if is 1 then 13: Adaptive aggregation 14: else 15: 16: end if 17: end for 18: end procedure |
19: procedure
WorkerUpdate() 20: //Run on worker u 21: (split data into batches size of B) 22: for each local epoch i from 1 to do 23: for batch do 24: 25: end for 26: end for 27: return w to server 28: end procedure |