Package that allows you to implement a Flower client in NodeJs in order to create federated learning with tensorflow.js.
Install :
- python >= 3.6
- flower library :
pip install flwr - nodejs
- npm
Same usage as the Python version.
Create a client that override the client class and fill the 4 methods, like "example/tfjs_Client.js".
const {Client} = require('flower-client');
class Tfjs_Client extends Client{
...
}Modify if necessary the "server.py" and run it.
Finally, run the clients by using start_tfjs_client.
const {start_tfjs_client} = require('flower-client');
const tfjs_client = new Tfjs_Client();
await start_tfjs_client('<ip>:<port>', tfjs_Client,);- Clone repository
- Get into the folder :
cd <path to the folder> - Installation:
npm i - Get into the folder example:
cd example - Run the server :
python server.py - Run client#1 :
node index.js - Run client#2 :
node index.js