p2pfl.learning.frameworks.pytorch.callbacks.fedprox_callback moduleΒΆ
FedProx Callback for PyTorch Lightning.
- class p2pfl.learning.frameworks.pytorch.callbacks.fedprox_callback.FedProxCallback[source]ΒΆ
Bases:
Callback
,P2PFLCallback
PyTorch Lightning Callback to implement the FedProx algorithm.
This callback modifies the gradients before the optimizer step by adding the gradient of the proximal term: mu * (w - w_t).