federated-learning-mock-server
npm i federated-learning-mock-server

federated-learning-mock-server

Federated learning experiment using TensorFlow.js

by PAIR-code

0.0.5 (see all)License:Apache-2.0TypeScript:Built-In
npm i federated-learning-mock-server
Readme

Tensorflow.js Federated Learning Mock Server

This library serves as a browser-compatible mock of the Node.js server library.

Usage

// client-side javascript
import {MockServer as FederatedServer} from 'federated-learning-mock-server';
import {Client as FederatedClient} from 'federated-learning-client';

const model = await tf.loadModel('https://my.model.json');

// create a mock, in-memory only version of the federated server
const server = new FederatedServer(model);
await server.setup();

// create two clients and link them to the server via `newClientSocket`
const client1 = new FederatedClient(server.newClientSocket, model);
const client2 = new FederatedClient(server.newClientSocket, model);
await client1.setup();
await client2.setup();

Downloads/wk

1

GitHub Stars

150

LAST COMMIT

3yrs ago

MAINTAINERS

4

CONTRIBUTORS

2

OPEN ISSUES

12

OPEN PRs

61
VersionTagPublished
0.0.5
latest
4yrs ago
No alternatives found
No tutorials found
Add a tutorial