README.md 836 字节
Newer Older
J
jhjiangcs 已提交
1
## Instructions for Pre-trained Model Encryption and Update with Paddle-MPC
2 3 4

([简体中文](./README_CN.md)|English)

J
jhjiangcs 已提交
5
This document introduces how to encrypt pre-trained plaintext model and update it based on Paddle-MPC.
6

J
jhjiangcs 已提交
7
### 1. Train PaddlePaddle Model, Encrypt, and Save
8 9 10 11 12 13 14

Train plaintext PaddlePaddle model, encrypt, and save with the following script.

```bash
python train_and_encrypt_model.py
```

J
jhjiangcs 已提交
15
### 2. Prepare Data
16

J
jhjiangcs 已提交
17
Run script `../process_data.py` to generate encrypted training and testing data for updating encrypted model.
18

J
jhjiangcs 已提交
19
### 3. Update MPC Model
20 21 22 23 24 25 26

Update mpc model with the following script.

```bash
bash run_standalone.sh update_mpc_model.py
```

J
jhjiangcs 已提交
27
### 4. Decrypt Loss Data
28

J
jhjiangcs 已提交
29
Decrypt the loss data to test the correctness of encrypted model updating by running the following script.
30 31 32 33 34

```bash
python decrypt_mpc_loss.py
```