Skip to main content
. 2023 Jan 19;23(3):1152. doi: 10.3390/s23031152
Algorithm 2. Client Selection. The server selects clients and adjusts client’s training data
Input
K,   N={n1, n2,, nK} clients class information set, θKLD KLD threshold,h  maximum number of selected client,L number of classes
Output
selected client class information set Sinfo = {s1,r, s2,r,, sh,r}T
1: initialize Sinfo,data volume vector  vr=[vr1,vr2, , vrL]T
2: Sort N in descending order by the amount of data 𝓁Lnk𝓁, kN
3: repeat
4:   for each ncN do
5:    if Sinfo is empty then
6:     for each 𝓁, 𝓁 = 1, 2, …, L do
7:      vr𝓁 vr𝓁+nc𝓁
8:      sc,r𝓁 nc𝓁
9:       end for
10:     m  max(vr) //Maximum value among vr
11:     add sc,r in Sinfo
12:    else
13:     f argmin𝓁 (vr)
14:     if ncf>0 then
15:      for each 𝓁, 𝓁 = 1, 2, …, L do
16:       vr𝓁 vr𝓁 + min(mvr𝓁, nc𝓁)
17:       sc,r𝓁  min(mvr𝓁, nc𝓁)
18:      end for
19:      add sc,r in Sinfo
20:     end if
21:    end if
22:   end for
23: until |Sinfo|==h or DKL (PvrPuniform)<θKLD
24: return Sinfo