Skip to main content
. 2026 Feb 19;26(4):1326. doi: 10.3390/s26041326
Algorithm 1 Federated Averaging. The K Clients are denoted as k; B, E, and η Represent the Local Minibatch Size, Number of Local Epochs, and Learning Rate, Respectively
1: initialize w0
2: for each round t = 1, 2, … do
3: m ← max (C · K, 1)
4: Select a random subset of m clients from the total set of
 currently connected and eligible CAVs
5: St {1, 2,,K}
6: for each client k ∈ St in parallel do
7: Wt+1k ← ClientUpdate (k, Wt)
8: Wt+1k=1Knkn Wt+1k
9: ClientUpdate (k, w): ‖Run on client k
10: β ← (split Pk into batches of size b)
11: β = {b1, b2,…}
12: for each local epoch i from 1 to E do
13: for batch b ∈ β do
14: w ← w − η▽ℓ (w; b)
15: return w to server