Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
639e920b
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看板
未验证
提交
639e920b
编写于
5月 12, 2020
作者:
D
Dong Daxiang
提交者:
GitHub
5月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #66 from qjing666/bug_fix
Fix bugs in new version
上级
e0c7192c
34606bc9
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
155 addition
and
33 deletion
+155
-33
CMakeLists.txt
CMakeLists.txt
+1
-1
python/paddle_fl/mpc/examples/mnist_demo/mnist_demo.py
python/paddle_fl/mpc/examples/mnist_demo/mnist_demo.py
+2
-2
python/paddle_fl/mpc/examples/mnist_demo/prepare_data.py
python/paddle_fl/mpc/examples/mnist_demo/prepare_data.py
+2
-2
python/paddle_fl/mpc/examples/mnist_demo/run_standalone.sh
python/paddle_fl/mpc/examples/mnist_demo/run_standalone.sh
+70
-0
python/paddle_fl/mpc/examples/run_standalone.sh
python/paddle_fl/mpc/examples/run_standalone.sh
+0
-5
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
+3
-0
python/paddle_fl/mpc/examples/uci_demo/run_standalone.sh
python/paddle_fl/mpc/examples/uci_demo/run_standalone.sh
+70
-0
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
+2
-2
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/version.py
python/paddle_fl/paddle_fl/version.py
+0
-16
python/setup.py
python/setup.py
+2
-2
python/version.py
python/version.py
+0
-0
未找到文件。
CMakeLists.txt
浏览文件 @
639e920b
...
@@ -22,7 +22,7 @@ elseif (LINUX)
...
@@ -22,7 +22,7 @@ elseif (LINUX)
endif
()
endif
()
if
(
NOT PYTHON_EXECUTABLE
)
if
(
NOT PYTHON_EXECUTABLE
)
set
(
PYTHON_EXECUTABLE python
3
)
set
(
PYTHON_EXECUTABLE python
)
endif
()
endif
()
find_program
(
PYTHON
${
PYTHON_EXECUTABLE
}
)
find_program
(
PYTHON
${
PYTHON_EXECUTABLE
}
)
...
...
python/paddle_fl/mpc/examples/mnist_demo/mnist_demo.py
浏览文件 @
639e920b
...
@@ -86,9 +86,9 @@ step = 0
...
@@ -86,9 +86,9 @@ step = 0
for
epoch_id
in
range
(
epoch_num
):
for
epoch_id
in
range
(
epoch_num
):
# feed data via loader
# feed data via loader
for
sample
in
loader
():
for
sample
in
loader
():
exe
.
run
(
feed
=
sample
)
loss
=
exe
.
run
(
feed
=
sample
,
fetch_list
=
[
cost
.
name
]
)
if
step
%
50
==
0
:
if
step
%
50
==
0
:
print
(
'Epoch={}, Step={}
'
.
format
(
epoch_id
,
step
))
print
(
'Epoch={}, Step={}
, loss={}'
.
format
(
epoch_id
,
step
,
loss
))
step
+=
1
step
+=
1
end_time
=
time
.
time
()
end_time
=
time
.
time
()
...
...
python/paddle_fl/mpc/examples/mnist_demo/prepare_data.py
浏览文件 @
639e920b
...
@@ -94,6 +94,6 @@ def decrypt_data_to_file(filepath, shape, decrypted_filepath):
...
@@ -94,6 +94,6 @@ def decrypt_data_to_file(filepath, shape, decrypted_filepath):
for
i
in
p
:
for
i
in
p
:
f
.
write
(
str
(
i
)
+
'
\n
'
)
f
.
write
(
str
(
i
)
+
'
\n
'
)
#
generate_encrypted_data()
generate_encrypted_data
()
#
generate_encrypted_test_data()
generate_encrypted_test_data
()
python/paddle_fl/mpc/examples/mnist_demo/run_standalone.sh
0 → 100755
浏览文件 @
639e920b
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
#
# A tools to faciliate the parallel running of fluid_encrypted test scrips.
# A test script is EXPECTED to accepted arguments in the following format:
#
# SCRIPT_NAME $ROLE $SERVER $PORT
# ROLE: the role of the running party
# SERVER: the address of the party discovering service
# PORT: the port of the party discovering service
#
# This tool will try to fill the above three argument to the test script,
# so that totally three processes running the script will be started, to
# simulate run of three party in a standalone machine.
#
# Usage of this script:
#
# bash run_standalone.sh TEST_SCRIPT_NAME
#
# modify the following vars according to your environment
PYTHON
=
"python"
REDIS_HOME
=
"path_to_redis_bin"
SERVER
=
"localhost"
PORT
=
9937
function
usage
()
{
echo
'run_standalone.sh SCRIPT_NAME [ARG...]'
exit
0
}
if
[
$#
-lt
1
]
;
then
usage
fi
SCRIPT
=
$1
if
[
!
-f
$SCRIPT
]
;
then
echo
'Could not find script of '
$SCRIPT
exit
1
fi
REDIS_BIN
=
$REDIS_HOME
/redis-cli
if
[
!
-f
$REDIS_BIN
]
;
then
echo
'Could not find redis cli in '
$REDIS_HOME
exit
1
fi
# clear the redis cache
$REDIS_BIN
-h
$SERVER
-p
$PORT
flushall
for
role
in
{
1..2
}
;
do
$PYTHON
$SCRIPT
$role
$SERVER
$PORT
2>&1
>
/dev/null &
done
# for party of role 0, run in a foreground mode and show the output
$PYTHON
$SCRIPT
0
$SERVER
$PORT
python/paddle_fl/mpc/examples/run_standalone.sh
浏览文件 @
639e920b
...
@@ -32,13 +32,10 @@
...
@@ -32,13 +32,10 @@
#
#
# modify the following vars according to your environment
# modify the following vars according to your environment
LD_LIB_PATH
=
"path_to_needed_libs"
PYTHON
=
"python"
PYTHON
=
"python"
REDIS_HOME
=
"path_to_redis_bin"
REDIS_HOME
=
"path_to_redis_bin"
SERVER
=
"localhost"
SERVER
=
"localhost"
PORT
=
9937
PORT
=
9937
MPC_DATA_UTILS_MODULE_DIRPATH
=
"mpc_data_utils_so_dirpath"
export
PYTHONPATH
=
$MPC_DATA_UTILS_MODULE_DIRPATH
:
$PYTHONPATH
function
usage
()
{
function
usage
()
{
echo
'run_standalone.sh SCRIPT_NAME [ARG...]'
echo
'run_standalone.sh SCRIPT_NAME [ARG...]'
...
@@ -64,8 +61,6 @@ fi
...
@@ -64,8 +61,6 @@ fi
# clear the redis cache
# clear the redis cache
$REDIS_BIN
-h
$SERVER
-p
$PORT
flushall
$REDIS_BIN
-h
$SERVER
-p
$PORT
flushall
# kick off script with roles of 1 and 2, and redirect output to /dev/null
export
LD_LIBRARY_PATH
=
$LD_LIB_PATH
:
$LD_LIBRARY_PATH
for
role
in
{
1..2
}
;
do
for
role
in
{
1..2
}
;
do
$PYTHON
$SCRIPT
$role
$SERVER
$PORT
2>&1
>
/dev/null &
$PYTHON
$SCRIPT
$role
$SERVER
$PORT
2>&1
>
/dev/null &
...
...
python/paddle_fl/mpc/examples/uci_demo/prepare_data.py
浏览文件 @
639e920b
...
@@ -60,3 +60,6 @@ def load_decrypt_data(filepath, shape):
...
@@ -60,3 +60,6 @@ def load_decrypt_data(filepath, shape):
for
instance
in
aby3_share_reader
():
for
instance
in
aby3_share_reader
():
p
=
aby3
.
reconstruct
(
np
.
array
(
instance
))
p
=
aby3
.
reconstruct
(
np
.
array
(
instance
))
print
(
p
)
print
(
p
)
generate_encrypted_data
()
python/paddle_fl/mpc/examples/uci_demo/run_standalone.sh
0 → 100755
浏览文件 @
639e920b
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
#
# A tools to faciliate the parallel running of fluid_encrypted test scrips.
# A test script is EXPECTED to accepted arguments in the following format:
#
# SCRIPT_NAME $ROLE $SERVER $PORT
# ROLE: the role of the running party
# SERVER: the address of the party discovering service
# PORT: the port of the party discovering service
#
# This tool will try to fill the above three argument to the test script,
# so that totally three processes running the script will be started, to
# simulate run of three party in a standalone machine.
#
# Usage of this script:
#
# bash run_standalone.sh TEST_SCRIPT_NAME
#
# modify the following vars according to your environment
PYTHON
=
"python"
REDIS_HOME
=
"path_to_redis_bin"
SERVER
=
"localhost"
PORT
=
9937
function
usage
()
{
echo
'run_standalone.sh SCRIPT_NAME [ARG...]'
exit
0
}
if
[
$#
-lt
1
]
;
then
usage
fi
SCRIPT
=
$1
if
[
!
-f
$SCRIPT
]
;
then
echo
'Could not find script of '
$SCRIPT
exit
1
fi
REDIS_BIN
=
$REDIS_HOME
/redis-cli
if
[
!
-f
$REDIS_BIN
]
;
then
echo
'Could not find redis cli in '
$REDIS_HOME
exit
1
fi
# clear the redis cache
$REDIS_BIN
-h
$SERVER
-p
$PORT
flushall
for
role
in
{
1..2
}
;
do
$PYTHON
$SCRIPT
$role
$SERVER
$PORT
2>&1
>
/dev/null &
done
# for party of role 0, run in a foreground mode and show the output
$PYTHON
$SCRIPT
0
$SERVER
$PORT
python/paddle_fl/paddle_fl/examples/dpsgd_demo/fl_server.py
浏览文件 @
639e920b
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
import
paddle_fl.paddle_fl
as
fl
import
paddle_fl.paddle_fl
as
fl
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.
paddle_fl.
core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
paddle_fl.
core.master.fl_job
import
FLRunTimeJob
server
=
FLServer
()
server
=
FLServer
()
server_id
=
0
server_id
=
0
job_path
=
"fl_job_config"
job_path
=
"fl_job_config"
...
...
python/paddle_fl/paddle_fl/examples/femnist_demo/fl_trainer.py
浏览文件 @
639e920b
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
from
paddle_fl.paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.paddle_fl.core.master.fl_job
import
FLRunTimeJob
import
paddle_fl.paddle_fl.dataset.femnist
import
paddle_fl.paddle_fl.dataset.femnist
as
femnist
import
numpy
import
numpy
import
sys
import
sys
import
paddle
import
paddle
...
@@ -76,7 +76,7 @@ while not trainer.stop():
...
@@ -76,7 +76,7 @@ while not trainer.stop():
#train_data,test_data= data_generater(trainer_id,inner_step=trainer._step,batch_size=64,count_by_step=count_by_step)
#train_data,test_data= data_generater(trainer_id,inner_step=trainer._step,batch_size=64,count_by_step=count_by_step)
train_reader
=
paddle
.
batch
(
train_reader
=
paddle
.
batch
(
paddle
.
reader
.
shuffle
(
paddle
.
reader
.
shuffle
(
paddle_fl
.
dataset
.
femnist
.
train
(
femnist
.
train
(
trainer_id
,
trainer_id
,
inner_step
=
trainer
.
_step
,
inner_step
=
trainer
.
_step
,
batch_size
=
64
,
batch_size
=
64
,
...
@@ -85,7 +85,7 @@ while not trainer.stop():
...
@@ -85,7 +85,7 @@ while not trainer.stop():
batch_size
=
64
)
batch_size
=
64
)
test_reader
=
paddle
.
batch
(
test_reader
=
paddle
.
batch
(
paddle_fl
.
dataset
.
femnist
.
test
(
femnist
.
test
(
trainer_id
,
trainer_id
,
inner_step
=
trainer
.
_step
,
inner_step
=
trainer
.
_step
,
batch_size
=
64
,
batch_size
=
64
,
...
...
python/paddle_fl/paddle_fl/version.py
已删除
100644 → 0
浏览文件 @
e0c7192c
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" PaddleFL version string """
fl_version
=
"0.2.0"
module_proto_version
=
"0.2.0"
python/setup.py
浏览文件 @
639e920b
...
@@ -22,7 +22,7 @@ import platform
...
@@ -22,7 +22,7 @@ import platform
from
setuptools
import
find_packages
from
setuptools
import
find_packages
from
setuptools
import
setup
from
setuptools
import
setup
from
paddle_fl.
version
import
fl_version
from
version
import
fl_version
def
python_version
():
def
python_version
():
"""
"""
...
@@ -34,7 +34,7 @@ def python_version():
...
@@ -34,7 +34,7 @@ def python_version():
max_version
,
mid_version
,
min_version
=
python_version
()
max_version
,
mid_version
,
min_version
=
python_version
()
REQUIRED_PACKAGES
=
[
REQUIRED_PACKAGES
=
[
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'paddlepaddle == 1.6.3'
'six >= 1.10.0'
,
'protobuf >= 3.1.0'
,
'paddlepaddle == 1.6.3'
,
'paddlepaddle-gpu >= 1.8'
]
]
if
max_version
<
3
:
if
max_version
<
3
:
...
...
python/
paddle_fl/
version.py
→
python/version.py
浏览文件 @
639e920b
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录