This repository contains the distributed implementation for federated learning algorithm under data sets that are heterogeneous. The algorithm is published in the paper titled 'Federated Learning Games for Reconfigurable Intelligent Surfaces via Causal Representations' (https://ieeexplore.ieee.org/document/10437657). The standalone implementation for the above paper can be found in the following repository.(https://github.com/ICONgroupCWC/FL_Heterogeneous)
Follow instructions given below to run the distributed implementation. The server and client can be run on different hardware
- numpy (pip install numpy)
- scikit-learn (pip install scikit-learn)
- pytorch 2.0 or latest
- websockets (pip install websockets)
- torchvision
- bson (pip install bson)
- tqdm (pip install tqdm)
Download Server code and run wbsocket_server.py.
The data to be tested against for calculating test accuracy during training should be stored in a subfolder in ./data folder.
- pytorch 2.0 or latest
- websockets (pip install websockets)
- torchvision
- numpy (pip install numpy)
- scikit-learn (pip install scikit-learn)
run python client_service.py 5000 (or any number for port) on the client device
The data to train the model should be stored in a subfolder in ./data folder.
Once server and the clients are running on dedicated hardware, the request for running the FL task can be initiated by running the start_fl.py program. This can be run on any hardware. Install follwing dependencies to run this file. Network configuration parameters (IP address, port) of server and clients should be updated in the network_config.yml file before running the script.
- numpy (pip install numpy)
- websockets (pip install websockets)
- matplotlib