Skip to content

Commit

Permalink
Changing static to model-centric
Browse files Browse the repository at this point in the history
  • Loading branch information
cereallarceny committed Jul 29, 2020
1 parent ce45dee commit 06e1bf9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion API-REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

## Syft

Syft client for static federated learning.
Syft client for model-centric federated learning.

### Parameters

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
![OpenCollective](https://img.shields.io/opencollective/all/openmined)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

# Syft.js
Expand Down Expand Up @@ -55,7 +57,7 @@ If you're not using a package manager, you will be able to include Syft.js withi

As a developer, there are few steps to building your own secure federated learning system upon the OpenMined infrastructure:

1. :robot: [Develop ML model and training procedure](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl/Part%2001%20-%20Create%20Plan.ipynb) (aka `Plan` in PySyft terminology) using [PySyft](https://github.com/OpenMined/PySyft).
1. :robot: [Develop ML model and training procedure](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl/Part%2001%20-%20Create%20Plan.ipynb) (aka `Plan` in PySyft terminology) using [PySyft](https://github.com/OpenMined/PySyft).
1. :earth_americas: Host model and Plans on [PyGrid](https://github.com/OpenMined/PyGrid), which will deal with all the federated learning components of your pipeline.
1. :tada: Execute the training on the variety of end-user devices using the client library (syft.js, [SwiftSyft](https://github.com/OpenMined/SwiftSyft), [KotlinSyft](https://github.com/OpenMined/KotlinSyft), [PySyft](https://github.com/OpenMined/PySyft)).
1. :lock: Securely aggregate trained user models in PyGrid.
Expand Down Expand Up @@ -96,7 +98,7 @@ job.on('accepted', async ({ model, clientConfig }) => {
const batches = LOAD_DATA(batchSize);

// Load model parameters.
let modelParams = model.params.map(p => p.clone());
let modelParams = model.params.map((p) => p.clone());

// Main training loop.
for (let [data, labels] of batches) {
Expand Down Expand Up @@ -127,7 +129,7 @@ job.on('rejected', ({ timeout }) => {
// Handle the job rejection, e.g. re-try after timeout.
});

job.on('error', err => {
job.on('error', (err) => {
// Handle errors.
});
```
Expand Down Expand Up @@ -209,7 +211,7 @@ PyGrid URL will need to be adjusted accordingly in further steps.
##### Create Model & Plan

After PyGrid is running, the next step is to create the model and training plan and host them in PyGrid.
PySyft tutorials include [MNIST example jupyter notebooks](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl) that guide you through this process.
PySyft tutorials include [MNIST example jupyter notebooks](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl) that guide you through this process.

Fire up jupyter notebook in PySyft root folder:

Expand All @@ -218,7 +220,7 @@ cd ~/fl-demo/PySyft
jupyter notebook --notebook-dir=$(pwd)
```

In the console, you should see URL you should open, or the browser will open automatically. After this, navigate to `examples/tutorials/static-fl` and [run the first notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl/Part%2001%20-%20Create%20Plan.ipynb). At this point, you can pull down the model and training plan with syft.js. However, if you'd like to see how to execute the plan using the PySyft FL worker, [try running the second notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl/Part%2002%20-%20Execute%20Plan.ipynb).
In the console, you should see URL you should open, or the browser will open automatically. After this, navigate to `examples/tutorials/model-centric-fl` and [run the first notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl/Part%2001%20-%20Create%20Plan.ipynb). At this point, you can pull down the model and training plan with syft.js. However, if you'd like to see how to execute the plan using the PySyft FL worker, [try running the second notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl/Part%2002%20-%20Execute%20Plan.ipynb).
##### PyGrid Clean-up
Expand Down Expand Up @@ -311,6 +313,7 @@ These people were integral part of the efforts to bring syft.js to fruition and
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## License
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with [PyGrid](https://github.com/OpenMined/pygrid) to train a plan on local data
## Quick Start

1. Install and start [PyGrid](https://github.com/OpenMined/pygrid)
2. Install [PySyft](https://github.com/OpenMined/PySyft) and [execute the "Part 01 - Create Plan" notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl/Part%2001%20-%20Create%20Plan.ipynb) from `examples/tutorials/static-fl` folder to seed the MNIST plan and model into PyGrid.
2. Install [PySyft](https://github.com/OpenMined/PySyft) and [execute the "Part 01 - Create Plan" notebook](https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl/Part%2001%20-%20Create%20Plan.ipynb) from `examples/tutorials/model-centric-fl` folder to seed the MNIST plan and model into PyGrid.
3. Now back in this folder, execute `npm install`
4. And then execute `npm start`

Expand Down
2 changes: 1 addition & 1 deletion examples/multi-armed-bandit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ While this demo is inherently simple, it's easy to see how one could extend it t
## Quick Start

1. Install and start [PyGrid](https://github.com/OpenMined/pygrid)
2. Install [PySyft](https://github.com/OpenMined/PySyft) and run the [Bandit create plan](<https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/static-fl/Part%2003%20-%20Create%20Plan%20(Bandit%20Demo).ipynb>).
2. Install [PySyft](https://github.com/OpenMined/PySyft) and run the [Bandit create plan](<https://github.com/OpenMined/PySyft/blob/master/examples/tutorials/model-centric-fl/Part%2003%20-%20Create%20Plan%20(Bandit%20Demo).ipynb>).
3. Now back in this folder, execute `npm install`
4. And then execute `npm start`

Expand Down
2 changes: 1 addition & 1 deletion src/syft.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Job from './job';
import ObjectRegistry from './object-registry';

/**
* Syft client for static federated learning.
* Syft client for model-centric federated learning.
*
* @param {Object} options
* @param {string} options.url - Full URL to PyGrid app (`ws` and `http` schemas supported).
Expand Down

0 comments on commit 06e1bf9

Please sign in to comment.