Skip to main content
. 2025 Mar 30;25(7):2197. doi: 10.3390/s25072197
Algorithm 3 Federated Learning Algorithm with Dynamic UE Selection using D4PG
Input: Global model parameters wglobal, UE dataset Dk for each UE k, hyperparameter λ for all UEs, maximum number of global iterations G, local training iterations L.
Output: Final global model parameters wglobal(G), trained D4PG agent, performance metrics.
  •  1:

    Initialization: Initialize global model parameters wglobal. Initialize the hyperparameter λ for all UEs.

  •  2:

    D4PG Agent Initialization: Initialize the D4PG agent with appropriate observation and action spaces, neural networks for policy and value functions, and experience replay buffer.

  •  3:

    Dynamic Sampling: At each global iteration g:

  •  4:

     D4PG agent dynamically selects a subset Ksampled of Kg UEs based on learned policies

  •  5:

    Global Model Broadcast: Broadcast the global model parameters wglobal to all UEs in Ksampled.

  •  6:

    Local Training: Each UE kKsampled performs local training:

  •  7:

     Initialize local model wlocal with wglobal.

  •  8:

    for (l=0,1,,L1) do

  •  9:

       Randomly select a data point ξk,g,l from local dataset Dk.

  • 10:

      Update local model: As shown in Equation (45)

  • 11:

    end for

  • 12:

    Send Local Models: Each UE sends its updated local model wlocal(g,L) to the base station.

  • 13:

    Global Model Aggregation: The base station aggregates the local models to update the global model: As shown in Equation (46)

  • 14:

    D4PG Agent Update: Update the D4PG agent using the reward based on the performance and fairness of the aggregated model, storing experiences in the replay buffer, and training the neural networks.

  • 15:

    Repeat: Repeat the process for G global iterations.