This is a fork of FedML framework with additional models
from repo emqx
- If pre-built binary packages aren't available for your OS, build from source is recommended (requires erlang and some other packages)
- In emqx.conf:
- Set
mqtt.max_packet_size = 20MB
- Set
mqtt.retain_available = true
- Set
- In plugins/emqx_retainer.conf:
- Set
retainer.max_payload_size = 20MB
- Set
Install in anaconda on server (recommended) and Raspberry Pi's machine env or virtual env (no conda due to unavailable tensorflow package on armv7l repo)
- In FedML/fedml_iot/cfg.py:
- Modify HOST variable to your MQTT broker's IP address in your network
- Modify APP_HOST variable to your server's IP address (Weight Aggregator)
- Make sure all clients and server are on the same network
- In run.sh:
- Modify server_ip to server's IP address,
- Modify client_uuid from 0 for each client
- Change run script for your model (VAE_LSTM_fedavg_rpi_client.py or lockedge_fedavg_rpi_client.py)
- Modify model configuration json file (for VAE-LSTM) to your needs
Instructions are written in chronological order of executions
- Run EMQ X broker:
cd
to bin folder (if built from source)./emqx start
(built from source) oremqx start
(binary package)
- Run Aggregator Server:
- Activate your installed environment
- VAE-LSTM Model:
python VAE-LSTM-app.py --config $(dir to model config file) --num-client $(number of workers)
- LockEdge Model:
python LCHA-app.py --client-num-per-round $(number of workers) --comm-round $(number of comm rounds)
After server has run, execute ./run.sh
Before re-run scripts on server and clients, restart EMQ X broker by ./emqx restart
or emqx restart