This project is a simulation of federated learning using Flower. In this project, a FedSoup adaptation for flower is trialed and compared with FedAvg. The model leveraged in this simulation is ResNet18. The adaptations are contained in the client.py file.
- Python 3.7 or higher
- PyTorch
- Flower
- Numpy
To run the simulation, use the following command:
python main.py --num_clients 5 --total_rounds 40 --alpha 0.75
fit method:
- Lines 65-90: obtaining parameters from server
- Line 92: Local training
- Lines 93-155 FedSoup Extension
get_parameters method:
- returns client parameters
evaluate method:
- Sets parameters with global parameters
- evaluates model on local test set
- returns results