FedMAP (Federated Maximum A Posteriori) is a novel federated learning (FL) algorithm that incorporates a global prior distribution over the local model parameters, enabling personalized FL. This repository contains the implementation of the FedMAP algorithm.
The FedMAP algorithm consists of three main steps:
-
Initialization: A client is randomly selected, and its model parameters are used to initialize the global model and the local model parameters for all clients.
-
Local Optimization: Each client optimizes their model parameters by minimizing the negative log-likelihood of the posterior distribution, which includes a prior term that penalizes deviations from the global model parameters.
-
Global Aggregation: The server aggregates the optimized local model parameters from all clients using a weighted average, where the weights are the weighting factors computed during the Local Optimization step. The updated global model is then broadcast to all clients for the next round of Local Optimization.
- 📂 FedMAP
- 📂 strategies # Contains the implementation of the FedMAP aggregation strategy
- 📜 utils.py # Utility functions for data preprocessing, model initialization, and other helper functions
- 📂 models # Directory containing the model architectures used in the experiments
- 📂 datasets # Directory containing the datasets used in the experiments
- 📂 config # Directory containing hydra configurations experiments setup
- 📜 README.md # The file you're currently reading
Run docker compose up --build
Open a new Tab and Run docker exec -it fedmap_container bash
Then Run python simulation.py