flower-client

1.0.2 • Public • Published

Flower NodeJs Client

Package that allows you to implement a Flower client in NodeJs in order to create federated learning with tensorflow.js.

Prerequisite

Install :

  • python >= 3.6
  • flower library : pip install flwr
  • nodejs
  • npm

How to use

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,);

Run the example

  • 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

Package Sidebar

Install

npm i flower-client

Weekly Downloads

0

Version

1.0.2

License

Apache-2.0

Unpacked Size

69 kB

Total Files

26

Last publish

Collaborators

  • julien-deramond
  • remiuhartegaray
  • bergin-emile
  • bbailleux
  • loic.laussel
  • teissere
  • nicolas-moteau
  • sebdurand
  • juliendelage
  • thierrybalandier