未验证 提交 47f174cb 编写于 作者: Q Qinghe JING 提交者: GitHub

Merge pull request #100 from hysunflower/bug_fix

bug_fix
...@@ -17,6 +17,7 @@ Process data for MNIST. ...@@ -17,6 +17,7 @@ Process data for MNIST.
import numpy as np import numpy as np
import paddle import paddle
import six import six
import os
from paddle_fl.mpc.data_utils import aby3 from paddle_fl.mpc.data_utils import aby3
sample_reader = paddle.dataset.mnist.train() sample_reader = paddle.dataset.mnist.train()
......
...@@ -31,7 +31,7 @@ export REDIS_PORT=/your/redis/port ...@@ -31,7 +31,7 @@ export REDIS_PORT=/your/redis/port
Launch demo with the `run_standalone.sh` script. The concrete command is: Launch demo with the `run_standalone.sh` script. The concrete command is:
```bash ```bash
bash run_standalone.sh uci_housing_demo.py bash run_standalone.sh uci_demo.py
``` ```
The loss with cypher text format will be displayed on screen while training. At the same time, the loss data would be also save in `/tmp` directory, and the format of file name is similar to what is described in Step 1. The loss with cypher text format will be displayed on screen while training. At the same time, the loss data would be also save in `/tmp` directory, and the format of file name is similar to what is described in Step 1.
...@@ -84,9 +84,9 @@ Data owner encrypts data. Concrete operations are consistent with “Prepare Dat ...@@ -84,9 +84,9 @@ Data owner encrypts data. Concrete operations are consistent with “Prepare Dat
According to the suffix of file name, distribute encrypted data files to `/tmp ` directories of all 3 computation parties. For example, send `house_feature.part0` and `house_label.part0` to `/tmp` of party 0 with `scp` command. According to the suffix of file name, distribute encrypted data files to `/tmp ` directories of all 3 computation parties. For example, send `house_feature.part0` and `house_label.part0` to `/tmp` of party 0 with `scp` command.
#### (3). Modify uci_housing_demo.py #### (3). Modify uci_demo.py
Each computation party makes the following modifications on `uci_housing_demo.py` according to the environment of machine. Each computation party makes the following modifications on `uci_demo.py` according to the environment of machine.
* Modify IP Information * Modify IP Information
...@@ -107,7 +107,7 @@ $REDIS_BIN -h $SERVER -p $PORT flushall ...@@ -107,7 +107,7 @@ $REDIS_BIN -h $SERVER -p $PORT flushall
Launch demo on each computation party with the following command, Launch demo on each computation party with the following command,
``` ```
$PYTHON_EXECUTABLE uci_housing_demo.py $PARTY_ID $SERVER $PORT $PYTHON_EXECUTABLE uci_demo.py $PARTY_ID $SERVER $PORT
``` ```
where PYTHON_EXECUTABLE is the python which installs PaddleFL, PARTY_ID is the ID of computation party, which is 0, 1, or 2, SERVER and PORT represent the IP and port of Redis server respectively. where PYTHON_EXECUTABLE is the python which installs PaddleFL, PARTY_ID is the ID of computation party, which is 0, 1, or 2, SERVER and PORT represent the IP and port of Redis server respectively.
......
...@@ -31,7 +31,7 @@ export REDIS_PORT=/your/redis/port ...@@ -31,7 +31,7 @@ export REDIS_PORT=/your/redis/port
然后使用`run_standalone.sh`脚本,启动并运行demo,命令如下: 然后使用`run_standalone.sh`脚本,启动并运行demo,命令如下:
```bash  ```bash 
bash run_standalone.sh uci_housing_demo.py bash run_standalone.sh uci_demo.py
``` ```
运行之后将在屏幕上打印训练过程中的密文loss数据,同时,对应的密文loss数据将会保存到/tmp目录下的文件中,文件命名格式类似于步骤1中所述。 运行之后将在屏幕上打印训练过程中的密文loss数据,同时,对应的密文loss数据将会保存到/tmp目录下的文件中,文件命名格式类似于步骤1中所述。
...@@ -85,9 +85,9 @@ fi ...@@ -85,9 +85,9 @@ fi
`house_feature.part0``house_label.part0`发送到party0的/tmp目录下。 `house_feature.part0``house_label.part0`发送到party0的/tmp目录下。
#### 3. 计算party修改uci_housing_demo.py脚本 #### 3. 计算party修改uci_demo.py脚本
各计算party根据自己的机器环境,对uci_housing_demo.py做如下改动: 各计算party根据自己的机器环境,对uci_demo.py做如下改动:
* 修改IP信息 * 修改IP信息
...@@ -109,7 +109,7 @@ $REDIS_BIN -h $SERVER -p $PORT flushall ...@@ -109,7 +109,7 @@ $REDIS_BIN -h $SERVER -p $PORT flushall
在各计算party分别执行以下命令,启动demo: 在各计算party分别执行以下命令,启动demo:
``` ```
$PYTHON_EXECUTABLE uci_housing_demo.py $PARTY_ID $SERVER $PORT $PYTHON_EXECUTABLE uci_demo.py $PARTY_ID $SERVER $PORT
``` ```
其中,PYTHON_EXECUTABLE表示自己安装了PaddleFL的python,PARTY_ID表示计算party的编号,值为0、1或2,SERVER和PORT分别表示redis server的IP地址和端口号。 其中,PYTHON_EXECUTABLE表示自己安装了PaddleFL的python,PARTY_ID表示计算party的编号,值为0、1或2,SERVER和PORT分别表示redis server的IP地址和端口号。
......
#!/bin/bash #!/bin/bash
# set redis server ip and port for test # set redis server ip and port for test
export TEST_REDIS_IP="test_redis_server_ip" export TEST_REDIS_IP=${LOCALHOST}
export TEST_REDIS_PORT="test_redis_port" export TEST_REDIS_PORT=${REDIS_PORT}
# unittest command # unittest command
PYTHON_TEST="python -m unittest" PYTHON_TEST="python -m unittest"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册