Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
ca2da649
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看板
提交
ca2da649
编写于
4月 29, 2020
作者:
J
jingqinghe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
15eacc08
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
114 addition
and
115 deletion
+114
-115
python/paddle_fl/mpc/__init__.py
python/paddle_fl/mpc/__init__.py
+1
-1
python/paddle_fl/mpc/examples/test_add.py
python/paddle_fl/mpc/examples/test_add.py
+4
-4
python/paddle_fl/mpc/examples/test_compare.py
python/paddle_fl/mpc/examples/test_compare.py
+3
-3
python/paddle_fl/mpc/examples/test_init.py
python/paddle_fl/mpc/examples/test_init.py
+2
-2
python/paddle_fl/mpc/examples/test_mixed.py
python/paddle_fl/mpc/examples/test_mixed.py
+8
-8
python/paddle_fl/mpc/examples/test_ml.py
python/paddle_fl/mpc/examples/test_ml.py
+7
-7
python/paddle_fl/mpc/examples/test_net.py
python/paddle_fl/mpc/examples/test_net.py
+9
-9
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
+1
-1
python/paddle_fl/mpc/examples/uci_demo/uci_housing_demo.py
python/paddle_fl/mpc/examples/uci_demo/uci_housing_demo.py
+9
-9
python/paddle_fl/mpc/tests/unittests/test_datautils_load_filter.py
...ddle_fl/mpc/tests/unittests/test_datautils_load_filter.py
+3
-4
python/paddle_fl/mpc/tests/unittests/test_model_encryption.py
...on/paddle_fl/mpc/tests/unittests/test_model_encryption.py
+2
-2
python/paddle_fl/paddle_fl/core/server/fl_server.py
python/paddle_fl/paddle_fl/core/server/fl_server.py
+1
-1
python/paddle_fl/paddle_fl/core/trainer/fl_trainer.py
python/paddle_fl/paddle_fl/core/trainer/fl_trainer.py
+1
-1
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_master.py
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_scheduler.py
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_scheduler.py
+1
-1
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_server.py
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_server.py
+3
-3
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_trainer.py
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_trainer.py
+2
-2
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_master.py
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
+1
-1
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_trainer.py
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_trainer.py
+2
-2
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_master.py
...on/paddle_fl/paddle_fl/examples/femnist_demo/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_scheduler.py
...paddle_fl/paddle_fl/examples/femnist_demo/fl_scheduler.py
+1
-1
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_server.py
...on/paddle_fl/paddle_fl/examples/femnist_demo/fl_server.py
+3
-3
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_trainer.py
...n/paddle_fl/paddle_fl/examples/femnist_demo/fl_trainer.py
+3
-3
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_master.py
...on/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_scheduler.py
...paddle_fl/paddle_fl/examples/gru4rec_demo/fl_scheduler.py
+1
-1
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_server.py
...on/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_server.py
+3
-3
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_trainer.py
...n/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_trainer.py
+3
-3
python/paddle_fl/paddle_fl/examples/k8s_deployment/master/fl_master.py
..._fl/paddle_fl/examples/k8s_deployment/master/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/k8s_deployment/scheduler/fl_scheduler.py
...ddle_fl/examples/k8s_deployment/scheduler/fl_scheduler.py
+1
-1
python/paddle_fl/paddle_fl/examples/k8s_deployment/server/fl_server.py
..._fl/paddle_fl/examples/k8s_deployment/server/fl_server.py
+3
-3
python/paddle_fl/paddle_fl/examples/k8s_deployment/trainer0/fl_trainer.py
.../paddle_fl/examples/k8s_deployment/trainer0/fl_trainer.py
+2
-2
python/paddle_fl/paddle_fl/examples/k8s_deployment/trainer1/fl_trainer.py
.../paddle_fl/examples/k8s_deployment/trainer1/fl_trainer.py
+2
-2
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_master.py
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_master.py
+3
-3
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_scheduler.py
.../paddle_fl/paddle_fl/examples/secagg_demo/fl_scheduler.py
+1
-1
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_server.py
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_server.py
+3
-3
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_trainer.py
...on/paddle_fl/paddle_fl/examples/secagg_demo/fl_trainer.py
+2
-2
python/paddle_fl/paddle_fl/examples/submitter_demo/scheduler_client.py
..._fl/paddle_fl/examples/submitter_demo/scheduler_client.py
+4
-4
python/paddle_fl/paddle_fl/examples/submitter_demo/train_program.py
...dle_fl/paddle_fl/examples/submitter_demo/train_program.py
+4
-4
未找到文件。
python/paddle_fl/mpc/__init__.py
浏览文件 @
ca2da649
...
...
@@ -20,7 +20,7 @@ import sys
import
sysconfig
import
paddle.fluid
as
fluid
_paddle_enc_root
=
sysconfig
.
get_paths
()[
"purelib"
]
+
"/paddle_
encrypted
"
_paddle_enc_root
=
sysconfig
.
get_paths
()[
"purelib"
]
+
"/paddle_
fl/mpc
"
_paddle_enc_lib_path
=
_paddle_enc_root
+
'/libs'
_paddle_enc_lib
=
_paddle_enc_lib_path
+
'/libpaddle_enc.so'
...
...
python/paddle_fl/mpc/examples/test_add.py
浏览文件 @
ca2da649
...
...
@@ -21,15 +21,15 @@ import env_set
import
sys
import
numpy
as
np
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
# call mpc add
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
data_1
=
p
addle_en
c
.
data
(
name
=
'data_1'
,
shape
=
[
8
],
dtype
=
'int64'
)
data_2
=
p
addle_en
c
.
data
(
name
=
'data_2'
,
shape
=
[
8
],
dtype
=
'int64'
)
data_1
=
p
fl_mp
c
.
data
(
name
=
'data_1'
,
shape
=
[
8
],
dtype
=
'int64'
)
data_2
=
p
fl_mp
c
.
data
(
name
=
'data_2'
,
shape
=
[
8
],
dtype
=
'int64'
)
d_1
=
np
.
array
(
[[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
],
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
]]).
astype
(
'int64'
)
...
...
python/paddle_fl/mpc/examples/test_compare.py
浏览文件 @
ca2da649
...
...
@@ -22,13 +22,13 @@ import time
import
sys
import
numpy
as
np
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
data_1
=
p
addle_en
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_1
=
p
fl_mp
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_2
=
fluid
.
data
(
name
=
'data_2'
,
shape
=
[
1
,
2
,
2
],
dtype
=
'float32'
)
out_gt
=
data_1
>
data_2
...
...
python/paddle_fl/mpc/examples/test_init.py
浏览文件 @
ca2da649
...
...
@@ -20,12 +20,12 @@ import env_set
import
sys
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
# call mpc init
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
exe
=
fluid
.
Executor
(
place
=
fluid
.
CPUPlace
())
exe
.
run
()
...
...
python/paddle_fl/mpc/examples/test_mixed.py
浏览文件 @
ca2da649
...
...
@@ -22,22 +22,22 @@ import time
import
sys
import
numpy
as
np
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
# call mpc add
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
data_1
=
p
addle_en
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_2
=
p
addle_en
c
.
data
(
name
=
'data_2'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_1
=
p
fl_mp
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_2
=
p
fl_mp
c
.
data
(
name
=
'data_2'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_3
=
fluid
.
data
(
name
=
'data_3'
,
shape
=
[
1
,
2
,
2
],
dtype
=
'int64'
)
out_sub
=
data_1
-
data_2
out_mul
=
p
addle_en
c
.
layers
.
mul
(
x
=
data_1
,
y
=
data_2
)
out_mean
=
p
addle_en
c
.
layers
.
mean
(
x
=
data_1
)
out_square
=
p
addle_en
c
.
layers
.
square
(
x
=
data_1
)
out_sum
=
p
addle_en
c
.
layers
.
sum
([
data_1
,
data_2
])
out_mul
=
p
fl_mp
c
.
layers
.
mul
(
x
=
data_1
,
y
=
data_2
)
out_mean
=
p
fl_mp
c
.
layers
.
mean
(
x
=
data_1
)
out_square
=
p
fl_mp
c
.
layers
.
square
(
x
=
data_1
)
out_sum
=
p
fl_mp
c
.
layers
.
sum
([
data_1
,
data_2
])
d_1
=
np
.
array
([[[
10
,
10
],
[
10
,
10
]],
[[
10
,
10
],
[
10
,
10
]]]).
astype
(
'int64'
)
d_2
=
np
.
array
([[[
5
,
5
],
[
5
,
5
]],
[[
5
,
5
],
[
5
,
5
]]]).
astype
(
'int64'
)
...
...
python/paddle_fl/mpc/examples/test_ml.py
浏览文件 @
ca2da649
...
...
@@ -22,18 +22,18 @@ import time
import
sys
import
numpy
as
np
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
data_1
=
p
addle_en
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_2
=
p
addle_en
c
.
data
(
name
=
'data_2'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_1
=
p
fl_mp
c
.
data
(
name
=
'data_1'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
data_2
=
p
fl_mp
c
.
data
(
name
=
'data_2'
,
shape
=
[
2
,
2
],
dtype
=
'int64'
)
out_sec
=
p
addle_en
c
.
layers
.
square_error_cost
(
input
=
data_1
,
label
=
data_2
)
out_fc
=
p
addle_en
c
.
layers
.
fc
(
input
=
data_1
,
size
=
1
,
act
=
None
)
out_relu
=
p
addle_en
c
.
layers
.
relu
(
data_1
)
out_sec
=
p
fl_mp
c
.
layers
.
square_error_cost
(
input
=
data_1
,
label
=
data_2
)
out_fc
=
p
fl_mp
c
.
layers
.
fc
(
input
=
data_1
,
size
=
1
,
act
=
None
)
out_relu
=
p
fl_mp
c
.
layers
.
relu
(
data_1
)
d_1
=
np
.
array
([[[
10
,
10
],
[
10
,
10
]],
[[
10
,
10
],
[
10
,
10
]]]).
astype
(
'int64'
)
d_2
=
np
.
array
([[[
5
,
5
],
[
5
,
5
]],
[[
5
,
5
],
[
5
,
5
]]]).
astype
(
'int64'
)
...
...
python/paddle_fl/mpc/examples/test_net.py
浏览文件 @
ca2da649
...
...
@@ -15,25 +15,25 @@
import
env_set
import
numpy
as
np
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
fl.mpc
as
pfl_mp
c
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
batch_size
=
3
# x is in cypher text type
x
=
p
addle_en
c
.
data
(
name
=
'x'
,
shape
=
[
batch_size
,
8
],
dtype
=
'int64'
)
x
=
p
fl_mp
c
.
data
(
name
=
'x'
,
shape
=
[
batch_size
,
8
],
dtype
=
'int64'
)
# y is in cypher text type
y
=
p
addle_en
c
.
data
(
name
=
'y'
,
shape
=
[
batch_size
,
1
],
dtype
=
'int64'
)
y
=
p
fl_mp
c
.
data
(
name
=
'y'
,
shape
=
[
batch_size
,
1
],
dtype
=
'int64'
)
y_pre
=
p
addle_en
c
.
layers
.
fc
(
input
=
x
,
size
=
1
,
act
=
None
)
y_relu
=
p
addle_en
c
.
layers
.
relu
(
input
=
y_pre
)
cost
=
p
addle_en
c
.
layers
.
square_error_cost
(
input
=
y_relu
,
label
=
y
)
avg_loss
=
p
addle_en
c
.
layers
.
mean
(
cost
)
y_pre
=
p
fl_mp
c
.
layers
.
fc
(
input
=
x
,
size
=
1
,
act
=
None
)
y_relu
=
p
fl_mp
c
.
layers
.
relu
(
input
=
y_pre
)
cost
=
p
fl_mp
c
.
layers
.
square_error_cost
(
input
=
y_relu
,
label
=
y
)
avg_loss
=
p
fl_mp
c
.
layers
.
mean
(
cost
)
optimizer
=
p
addle_en
c
.
optimizer
.
SGD
(
learning_rate
=
0.001
)
optimizer
=
p
fl_mp
c
.
optimizer
.
SGD
(
learning_rate
=
0.001
)
optimizer
.
minimize
(
avg_loss
)
exe
=
fluid
.
Executor
(
place
=
fluid
.
CPUPlace
())
...
...
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
浏览文件 @
ca2da649
...
...
@@ -17,7 +17,7 @@ Prepare of UCI housing data for MPC usage
import
numpy
as
np
import
paddle
import
six
from
paddle_
encrypted
.data_utils
import
aby3
from
paddle_
fl.mpc
.data_utils
import
aby3
sample_reader
=
paddle
.
dataset
.
uci_housing
.
train
()
...
...
python/paddle_fl/mpc/examples/uci_demo/uci_housing_demo.py
浏览文件 @
ca2da649
...
...
@@ -20,11 +20,11 @@ import time
import
paddle
import
paddle.fluid
as
fluid
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
encrypted
.data_utils.aby3
as
aby3
import
paddle_
fl.mpc
as
pfl_mp
c
import
paddle_
fl.mpc
.data_utils.aby3
as
aby3
role
,
server
,
port
=
env_set
.
TestOptions
().
values
()
p
addle_en
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
p
fl_mp
c
.
init
(
"aby3"
,
int
(
role
),
"localhost"
,
server
,
int
(
port
))
role
=
int
(
role
)
# data preprocessing
...
...
@@ -36,8 +36,8 @@ label_reader = aby3.load_aby3_shares("/tmp/house_label", id=role, shape=(1, ))
batch_feature
=
aby3
.
batch
(
feature_reader
,
BATCH_SIZE
,
drop_last
=
True
)
batch_label
=
aby3
.
batch
(
label_reader
,
BATCH_SIZE
,
drop_last
=
True
)
x
=
p
addle_en
c
.
data
(
name
=
'x'
,
shape
=
[
BATCH_SIZE
,
13
],
dtype
=
'int64'
)
y
=
p
addle_en
c
.
data
(
name
=
'y'
,
shape
=
[
BATCH_SIZE
,
1
],
dtype
=
'int64'
)
x
=
p
fl_mp
c
.
data
(
name
=
'x'
,
shape
=
[
BATCH_SIZE
,
13
],
dtype
=
'int64'
)
y
=
p
fl_mp
c
.
data
(
name
=
'y'
,
shape
=
[
BATCH_SIZE
,
1
],
dtype
=
'int64'
)
# async data loader
loader
=
fluid
.
io
.
DataLoader
.
from_generator
(
...
...
@@ -47,13 +47,13 @@ place = fluid.CPUPlace()
loader
.
set_batch_generator
(
batch_sample
,
places
=
place
)
# network
y_pre
=
p
addle_en
c
.
layers
.
fc
(
input
=
x
,
size
=
1
)
y_pre
=
p
fl_mp
c
.
layers
.
fc
(
input
=
x
,
size
=
1
)
infer_program
=
fluid
.
default_main_program
().
clone
(
for_test
=
False
)
cost
=
p
addle_en
c
.
layers
.
square_error_cost
(
input
=
y_pre
,
label
=
y
)
avg_loss
=
p
addle_en
c
.
layers
.
mean
(
cost
)
optimizer
=
p
addle_en
c
.
optimizer
.
SGD
(
learning_rate
=
0.001
)
cost
=
p
fl_mp
c
.
layers
.
square_error_cost
(
input
=
y_pre
,
label
=
y
)
avg_loss
=
p
fl_mp
c
.
layers
.
mean
(
cost
)
optimizer
=
p
fl_mp
c
.
optimizer
.
SGD
(
learning_rate
=
0.001
)
optimizer
.
minimize
(
avg_loss
)
# loss file
...
...
python/paddle_fl/mpc/tests/unittests/test_datautils_load_filter.py
浏览文件 @
ca2da649
...
...
@@ -20,8 +20,7 @@ sys.path.append('../../../')
import
unittest
import
paddle_encrypted
as
paddle_enc
import
paddle_fl.mpc
as
pfl_mpc
class
TestDataUtilsLoadFilter
(
unittest
.
TestCase
):
def
__init__
(
self
,
methodName
=
'runTest'
):
...
...
@@ -46,7 +45,7 @@ class TestDataUtilsLoadFilter(unittest.TestCase):
def
test_load_data
(
self
):
expected_values
=
[
'111'
,
'222'
,
'333'
]
du
=
fluid_en
c
.
data_utils
.
DataUtils
()
du
=
pfl_mp
c
.
data_utils
.
DataUtils
()
for
data
,
value
in
zip
(
du
.
load_data
(
self
.
test_tmp_file
),
expected_values
):
self
.
assertEqual
(
data
,
value
)
...
...
@@ -57,7 +56,7 @@ class TestDataUtilsLoadFilter(unittest.TestCase):
]
id_list
=
[
0
,
2
]
expected_results
=
[
"0, 0.1, 0.1, 0.1, 1"
,
"2, 0.3, 0.3, 0.3, 1"
]
du
=
fluid_en
c
.
data_utils
.
DataUtils
()
du
=
pfl_mp
c
.
data_utils
.
DataUtils
()
filter_results
=
du
.
data_filter_by_id
(
input_list
=
to_filter
,
id_list
=
id_list
)
for
result
,
expect
in
zip
(
filter_results
,
expected_results
):
...
...
python/paddle_fl/mpc/tests/unittests/test_model_encryption.py
浏览文件 @
ca2da649
...
...
@@ -21,8 +21,8 @@ import numpy as np
import
os
import
shutil
import
unittest
import
paddle_
encrypted
as
paddle_en
c
import
paddle_
encrypted
.data_utils.aby3
as
aby3
import
paddle_
fl.mpc
as
pfl_mp
c
import
paddle_
fl.mpc
.data_utils.aby3
as
aby3
import
paddle.fluid
as
fluid
from
paddle.fluid.param_attr
import
ParamAttr
...
...
python/paddle_fl/paddle_fl/core/server/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle.fluid
as
fluid
from
paddle_fl.core.scheduler.agent_master
import
FLServerAgent
from
paddle_fl.
.jingqinghe_newname.
core.scheduler.agent_master
import
FLServerAgent
class
FLServer
(
object
):
...
...
python/paddle_fl/paddle_fl/core/trainer/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
logging
from
paddle_fl.core.scheduler.agent_master
import
FLWorkerAgent
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLWorkerAgent
import
numpy
import
hmac
import
hashlib
...
...
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
class
Model
(
object
):
...
...
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_scheduler.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
worker_num
=
2
server_num
=
1
...
...
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
server
=
FLServer
()
server_id
=
0
job_path
=
"fl_job_config"
...
...
python/paddle_fl/paddle_fl/examples/ctr_demo/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle.fluid
as
fluid
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
numpy
as
np
import
sys
import
logging
...
...
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
import
math
...
...
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
...
...
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
numpy
import
sys
import
paddle
...
...
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
class
Model
(
object
):
...
...
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_scheduler.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
worker_num
=
4
server_num
=
1
...
...
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
server
=
FLServer
()
server_id
=
0
job_path
=
"fl_job_config"
...
...
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
import
paddle_fl.dataset.femnist
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
paddle_fl.
jingqinghe_newname.
dataset.femnist
import
numpy
import
sys
import
paddle
...
...
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
class
Model
(
object
):
...
...
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_scheduler.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
worker_num
=
4
server_num
=
1
...
...
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
server
=
FLServer
()
server_id
=
0
job_path
=
"fl_job_config"
...
...
python/paddle_fl/paddle_fl/examples/gru4rec_demo/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.reader.gru4rec_reader
import
Gru4rec_Reader
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
reader.gru4rec_reader
import
Gru4rec_Reader
import
paddle.fluid
as
fluid
import
numpy
as
np
import
sys
...
...
python/paddle_fl/paddle_fl/examples/k8s_deployment/master/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -15,9 +15,9 @@
import
argparse
import
paddle.fluid
as
fluid
import
os
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
def
parse_args
():
...
...
python/paddle_fl/paddle_fl/examples/k8s_deployment/scheduler/fl_scheduler.py
浏览文件 @
ca2da649
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
import
argparse
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
def
parse_args
():
...
...
python/paddle_fl/paddle_fl/examples/k8s_deployment/server/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
os
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
time
server
=
FLServer
()
server_id
=
0
...
...
python/paddle_fl/paddle_fl/examples/k8s_deployment/trainer0/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle.fluid
as
fluid
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
numpy
as
np
import
sys
import
os
...
...
python/paddle_fl/paddle_fl/examples/k8s_deployment/trainer1/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle.fluid
as
fluid
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
numpy
as
np
import
sys
import
os
...
...
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_master.py
浏览文件 @
ca2da649
...
...
@@ -13,9 +13,9 @@
# limitations under the License.
import
paddle.fluid
as
fluid
import
paddle_fl
as
fl
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
import
paddle_fl
.jingqinghe_newname
as
fl
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
class
Model
(
object
):
...
...
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_scheduler.py
浏览文件 @
ca2da649
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
worker_num
=
2
server_num
=
1
...
...
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_server.py
浏览文件 @
ca2da649
...
...
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
server
=
FLServer
()
server_id
=
0
job_path
=
"fl_job_config"
...
...
python/paddle_fl/paddle_fl/examples/secagg_demo/fl_trainer.py
浏览文件 @
ca2da649
...
...
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
import
numpy
import
sys
import
logging
...
...
python/paddle_fl/paddle_fl/examples/submitter_demo/scheduler_client.py
浏览文件 @
ca2da649
...
...
@@ -18,11 +18,11 @@ import random
import
zmq
import
time
import
sys
from
paddle_fl.core.submitter.client_base
import
HPCClient
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.
jingqinghe_newname.
core.submitter.client_base
import
HPCClient
from
paddle_fl.
jingqinghe_newname.
core.scheduler.agent_master
import
FLScheduler
import
paddle.fluid
as
fluid
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
from
paddle_fl.
jingqinghe_newname.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
jingqinghe_newname.
core.strategy.fl_strategy_base
import
FLStrategyFactory
from
model
import
Model
import
tarfile
...
...
python/paddle_fl/paddle_fl/examples/submitter_demo/train_program.py
浏览文件 @
ca2da649
...
...
@@ -17,11 +17,11 @@ import random
import
zmq
import
os
import
tarfile
import
paddle_fl
as
fl
import
paddle_fl
.jingqinghe_newname
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.
jingqinghe_newname.
core.server.fl_server
import
FLServer
from
paddle_fl.
jingqinghe_newname.
core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
jingqinghe_newname.
core.trainer.fl_trainer
import
FLTrainerFactory
import
numpy
as
np
import
sys
import
logging
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录