FedAvg simplified

1 min readDec 19, 2022

Federated learning is a machine learning technique that enables multiple devices, such as smartphones or edge devices, to collaboratively train a model while keeping their data on the devices and never sending it to a central server. This approach has several advantages, such as privacy protection and the ability to train models on a much larger dataset that is distributed across devices.

One popular method for implementing federated learning is called federated averaging, or FedAvg for short. In FedAvg, the goal is to train a model that can accurately predict a target variable based on a set of input features, but the data for training the model is distributed across a large number of devices.

Here’s how FedAvg works:

  1. A central server selects a subset of devices to participate in the federated learning process.
  2. Each selected device downloads a copy of the current model and trains it on its local data.
  3. The devices then send their updated model parameters back to the central server.
  4. The central server averages the model parameters received from the devices to obtain an updated global model.
  5. The process repeats, with the central server selecting a new subset of devices to participate in the next round of training.

The main advantage of FedAvg is that it allows for collaborative model training without requiring any device to send its data to a central server. This makes it well-suited for scenarios where data privacy is a concern, such as in healthcare or finance.