This implementation is for beginners using the Flower framework. Here, the MNIST dataset and a simple Deep Learning framework is used. The scenario in here includes a server and two clients. Each client having different distribution of data (Non-IID data). FedAvg algorithm is used as the aggregation method on the server side.
Clone this repo using : git clone https://github.com/sharma-anee/Federated_Learning.git or else copy these codes into your own python editor and save into three seperate files as named here.
Steps to execute these codes:
- Open the command prompt, move into the exact directories wherever your files are and execute the server.py file using : python server.py.
- Open another command prompt (a new one), and execute the client1.py file using : python client1.py.
- Repeat the Step 2. using : python client2.py.
- Close the graphs generated by step 2 and step 3.
- You shall see the training and updated model parameters in each of the server and client command prompts window.
Note: Make sure you have a stable internet connection.
To understand how it actually works and basics of the mechanism, one must go through https://flower.dev/docs/.