|
Algorithm 1 System model of FL |
|
Input: Set of connected clients C , E is the number of global iteration , K is the number of local epoch, is the learning rate , b is the size of local mini batch , r is rate of client selection |
|
Output: Global model W
|
| 1: procedure
Server() |
▹ Central Server execute |
| 2:
|
▹ Initialize global model, constant K
|
| 3: for global iteration do
|
| 4:
|
| 5: ClientSelection (C, N) |
▹ Select client for train |
| 6: for each client in parallel do
|
| 7: Broadcast to client
|
| 8: ClientUpdate
|
▹ aggregate model |
| 9: end for
|
| 10: Update global model
|
| 11 end for
|
|
| 12: end procedure
|
|
| 13: |
|
| 14: |
|
| 15: procedure clientupdate() |
| 16: B← split local data into batches of size b
|
| 17: Replace local model ←
|
| 18: for local epoch e≤K do
|
| 19: for batch data b∈B do
|
| 20:
|
▹ mini-batch SGD |
| 21: end for
|
| 22: end for
|
| 23: Upload local update result
|
| 24: end procedure
|