Lyapunov-based optimization of edge resources for energy-efficient adaptive federated learning