|
Algorithm 2 Algorithm of CATA-Fed |
|
Input: Set of connected clients C , the number of global iteration E , deadline T, the number of cluster P, learning rate , the number of participating clients N, lower limit size of sub-dataset
|
|
Output: Global model W
|
-
1:
procedure
Server()
-
2:
Initialize
-
3:
client clustering according to Equation (20)
-
4:
for global iteration do
-
5:
if
, and detect report of client then
-
6:
Reclustering according to Equation (20)
-
7:
end if
-
8:
Update of client according to Equation (21)
-
9:
Grouping clients according to Equation (23)
-
10:
Calculate priority according to Equation (24)
-
11:
according to Equation (25)
-
12:
for each client in parallel do
-
13:
Broadcast to client
-
14:
ClientUpdate
-
15:
end for
-
16:
Update global model
-
17:
-
18:
end for
-
19:
end procedure
-
20:
-
21:
procedureclientupdate()
-
22:
Initialize
-
23:
-
24:
Select training data ,
-
25:
Replace local model ←
-
26:
Check start training time
-
27:
Working BreakProcess() in parallel
-
28:
for local epoch do
-
29:
if then
-
30:
Break training
-
31:
else
-
32:
-
33:
Get training time
-
34:
Update average of training time
-
35:
end if
-
36:
end for
-
37:
Upload to server
-
38:
if is 0 then
-
39:
Update according to Equation (10)
-
40:
Partitioning sub-dataset according to Equation (11)
-
41:
Report to server
-
42:
end if
-
43:
end procedure
-
44:
-
45:
procedurebreakprocess()
-
46:
if then
-
47:
Break training &
-
48:
end if
-
49:
end procedure
|