From 6767d07a8e911a9fb0b6afcfd76ba38a1e282935 Mon Sep 17 00:00:00 2001 From: qjing666 Date: Wed, 8 Jan 2020 14:55:16 +0800 Subject: [PATCH] update documents --- .../image_classification/README.md | 8 ++++---- docs/source/examples/md/dpsgd-example.md | 1 + docs/source/examples/md/gru4rec_examples.md | 1 + docs/source/md/introduction.md | 4 +++- docs/source/md/quick_start.md | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/contrib/data_safety_training/image_classification/README.md b/contrib/data_safety_training/image_classification/README.md index 026b0c0..b560fe6 100644 --- a/contrib/data_safety_training/image_classification/README.md +++ b/contrib/data_safety_training/image_classification/README.md @@ -14,16 +14,16 @@ ## Start the service on Server side -``` -#python +```sh + python server/receiver.py ``` ## Start the request on User side -``` -#python +```sh + python submitter.py ``` diff --git a/docs/source/examples/md/dpsgd-example.md b/docs/source/examples/md/dpsgd-example.md index 7bff71b..b0b8227 100644 --- a/docs/source/examples/md/dpsgd-example.md +++ b/docs/source/examples/md/dpsgd-example.md @@ -101,6 +101,7 @@ job_generator.generate_fl_job( How to work in RunTime ``` +python -u fl_scheduler.py >scheduler.log & python -u fl_server.py >server0.log & python -u fl_trainer.py 0 data/ >trainer0.log & python -u fl_trainer.py 1 data/ >trainer1.log & diff --git a/docs/source/examples/md/gru4rec_examples.md b/docs/source/examples/md/gru4rec_examples.md index f5c0398..ea729ad 100644 --- a/docs/source/examples/md/gru4rec_examples.md +++ b/docs/source/examples/md/gru4rec_examples.md @@ -70,6 +70,7 @@ job_generator.generate_fl_job( ### How to work in RunTime ```sh +python -u fl_scheduler.py >scheduler.log & python -u fl_server.py >server0.log & python -u fl_trainer.py 0 data/ >trainer0.log & python -u fl_trainer.py 1 data/ >trainer1.log & diff --git a/docs/source/md/introduction.md b/docs/source/md/introduction.md index 51bf7b8..8c15136 100644 --- a/docs/source/md/introduction.md +++ b/docs/source/md/introduction.md @@ -26,7 +26,7 @@ In PaddleFL, horizontal and vertical federated learning strategies will be imple ## Framework design of PaddleFL - + In PaddleFL, components for defining a federated learning task and training a federated learning job are as follows: @@ -46,6 +46,8 @@ In PaddleFL, components for defining a federated learning task and training a fe - **FL-Worker**: Each organization participates in federated learning will have one or more federated workers that will communicate with the federated parameter server. +- **FL-scheduler**: Decide which set of trainers can join the training before each updating cycle. + ## On Going and Future Work - Experimental benchmark with public datasets in federated learning settings. diff --git a/docs/source/md/quick_start.md b/docs/source/md/quick_start.md index e5dd193..be47261 100644 --- a/docs/source/md/quick_start.md +++ b/docs/source/md/quick_start.md @@ -60,6 +60,20 @@ We can define a secure service to send programs to each node in FLJob. There are ## Step 3: Start Federated Learning Run-Time +On FL Scheduler Node, number of servers and workers are defined. Besides, the number of workers that participate in each upating cycle is also determined. Finally, the FL Scheduler waits servers and workers to initialize. + +```python +from paddle_fl.core.scheduler.agent_master import FLScheduler + +worker_num = 2 +server_num = 1 +scheduler = FLScheduler(worker_num,server_num) +scheduler.set_sample_worker_num(worker_num) +scheduler.init_env() +print("init env done.") +scheduler.start_fl_training() + + On FL Trainer Node, a training script is defined as follows: ``` python -- GitLab