Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
8f8ab2c0
P
PaddleFL
项目概览
PaddlePaddle
/
PaddleFL
通知
35
Star
5
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
4
Wiki
3
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleFL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
3
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8f8ab2c0
编写于
5月 17, 2020
作者:
J
jingqinghe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update document
上级
5235ce6d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
15 deletion
+44
-15
docs/source/examples/md/dpsgd-example.md
docs/source/examples/md/dpsgd-example.md
+21
-6
docs/source/examples/md/gru4rec_examples.md
docs/source/examples/md/gru4rec_examples.md
+9
-7
docs/source/examples/md/sec_agg_example.md
docs/source/examples/md/sec_agg_example.md
+14
-2
未找到文件。
docs/source/examples/md/dpsgd-example.md
浏览文件 @
8f8ab2c0
...
@@ -4,14 +4,14 @@ This document introduces how to use PaddleFL to train a model with Fl Strategy:
...
@@ -4,14 +4,14 @@ This document introduces how to use PaddleFL to train a model with Fl Strategy:
### Dependencies
### Dependencies
-
paddlepaddle>=1.
6
-
paddlepaddle>=1.
8
### How to install PaddleFL
### How to install PaddleFL
Please use p
ython
which has paddlepaddle installed
Please use p
ip
which has paddlepaddle installed
```
```
p
ython setup.py instal
l
p
ip install paddle_f
l
```
```
### Model
### Model
...
@@ -98,15 +98,28 @@ job_generator.generate_fl_job(
...
@@ -98,15 +98,28 @@ job_generator.generate_fl_job(
strategy
,
server_endpoints
=
endpoints
,
worker_num
=
2
,
output
=
output
)
strategy
,
server_endpoints
=
endpoints
,
worker_num
=
2
,
output
=
output
)
```
```
How to work in RunTime
####
How to work in RunTime
```
```
python -u fl_scheduler.py >scheduler.log &
python -u fl_scheduler.py >scheduler.log &
python -u fl_server.py >server0.log &
python -u fl_server.py >server0.log &
python -u fl_trainer.py 0 data/ >trainer0.log &
python -u fl_trainer.py 0 >trainer0.log &
python -u fl_trainer.py 1 data/ >trainer1.log &
python -u fl_trainer.py 1 >trainer1.log &
python -u fl_trainer.py 2 >trainer2.log &
python -u fl_trainer.py 3 >trainer3.log &
```
```
In fl_scheduler.py, we let server and trainers to do registeration.
```
worker_num = 4
server_num = 1
#Define number of worker/server and the port for scheduler
scheduler = FLScheduler(worker_num, server_num, port=9091)
scheduler.set_sample_worker_num(4)
scheduler.init_env()
print("init env done.")
scheduler.start_fl_training()
```
In fl_server.py, we load and run the FL server job.
In fl_server.py, we load and run the FL server job.
```
```
...
@@ -115,7 +128,9 @@ server_id = 0
...
@@ -115,7 +128,9 @@ server_id = 0
job_path = "fl_job_config"
job_path = "fl_job_config"
job = FLRunTimeJob()
job = FLRunTimeJob()
job.load_server_job(job_path, server_id)
job.load_server_job(job_path, server_id)
job._scheduler_ep = "127.0.0.1:9091" # IP address for scheduler
server.set_server_job(job)
server.set_server_job(job)
server._current_ep = "127.0.0.1:8181" # IP address for server
server.start()
server.start()
```
```
...
...
docs/source/examples/md/gru4rec_examples.md
浏览文件 @
8f8ab2c0
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
This document introduces how to use PaddleFL to train a model with Fl Strategy.
This document introduces how to use PaddleFL to train a model with Fl Strategy.
### Dependencies
### Dependencies
-
paddlepaddle>=1.
6
-
paddlepaddle>=1.
8
### How to install PaddleFL
### How to install PaddleFL
Please use python which has paddlepaddle installed
Please use pip which has paddlepaddle installed
```
sh
```
sh
p
ython setup.py
instal
l
p
ip
install
paddle_f
l
```
```
### Model
### Model
...
@@ -20,7 +21,6 @@ Public Dataset [Rsc15](https://2015.recsyschallenge.com)
...
@@ -20,7 +21,6 @@ Public Dataset [Rsc15](https://2015.recsyschallenge.com)
```
sh
```
sh
#download data
#download data
cd
example/gru4rec_demo
sh download.sh
sh download.sh
```
```
...
@@ -63,7 +63,7 @@ strategy = build_strategy.create_fl_strategy()
...
@@ -63,7 +63,7 @@ strategy = build_strategy.create_fl_strategy()
endpoints
=
[
"127.0.0.1:8181"
]
endpoints
=
[
"127.0.0.1:8181"
]
output
=
"fl_job_config"
output
=
"fl_job_config"
job_generator
.
generate_fl_job
(
job_generator
.
generate_fl_job
(
strategy
,
server_endpoints
=
endpoints
,
worker_num
=
2
,
output
=
output
)
strategy
,
server_endpoints
=
endpoints
,
worker_num
=
4
,
output
=
output
)
```
```
...
@@ -72,8 +72,10 @@ job_generator.generate_fl_job(
...
@@ -72,8 +72,10 @@ job_generator.generate_fl_job(
```
sh
```
sh
python
-u
fl_scheduler.py
>
scheduler.log &
python
-u
fl_scheduler.py
>
scheduler.log &
python
-u
fl_server.py
>
server0.log &
python
-u
fl_server.py
>
server0.log &
python
-u
fl_trainer.py 0 data/
>
trainer0.log &
python
-u
fl_trainer.py 0
>
trainer0.log &
python
-u
fl_trainer.py 1 data/
>
trainer1.log &
python
-u
fl_trainer.py 1
>
trainer1.log &
python
-u
fl_trainer.py 2
>
trainer2.log &
python
-u
fl_trainer.py 3
>
trainer3.log &
```
```
fl_trainer.py can define own reader according to data.
fl_trainer.py can define own reader according to data.
```
python
```
python
...
...
docs/source/examples/md/sec_agg_example.md
浏览文件 @
8f8ab2c0
...
@@ -8,7 +8,7 @@ This document introduces how to use PaddleFL to train a model with Fl Strategy:
...
@@ -8,7 +8,7 @@ This document introduces how to use PaddleFL to train a model with Fl Strategy:
### How to install PaddleFL
### How to install PaddleFL
Please use p
ython
which has paddlepaddle installed
Please use p
ip
which has paddlepaddle installed
```
```
pip install paddle_fl
pip install paddle_fl
...
@@ -96,7 +96,7 @@ job_generator.generate_fl_job(
...
@@ -96,7 +96,7 @@ job_generator.generate_fl_job(
```
```
How to work in RunTime
####
How to work in RunTime
```
shell
```
shell
python3 fl_master.py
python3 fl_master.py
...
@@ -107,6 +107,18 @@ python3 -u fl_trainer.py 0 >log/trainer0.log &
...
@@ -107,6 +107,18 @@ python3 -u fl_trainer.py 0 >log/trainer0.log &
sleep
2
sleep
2
python3
-u
fl_trainer.py 1
>
log/trainer1.log &
python3
-u
fl_trainer.py 1
>
log/trainer1.log &
```
```
In fl_scheduler.py, we let server and trainers to do registeration.
```
worker_num = 2
server_num = 1
#Define number of worker/server and the port for scheduler
scheduler = FLScheduler(worker_num, server_num, port=9091)
scheduler.set_sample_worker_num(2)
scheduler.init_env()
print("init env done.")
scheduler.start_fl_training()
```
In fl_server.py, we load and run the FL server job.
In fl_server.py, we load and run the FL server job.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录