Skip to content

Commit

Permalink
Merge pull request #5255 from FederatedAI/develop-1.11.4
Browse files Browse the repository at this point in the history
Update examples and doc
  • Loading branch information
dylan-fan committed Nov 10, 2023
2 parents c2c2e0c + 45ec38a commit 87dd4f6
Show file tree
Hide file tree
Showing 409 changed files with 4,053 additions and 898 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[submodule "eggroll"]
path = eggroll
url = https://github.com/WeBankFinTech/eggroll.git
branch = v2.5.2
branch = v2.5.3
[submodule "fateflow"]
path = fateflow
url = https://github.com/FederatedAI/FATE-Flow.git
Expand Down
11 changes: 10 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Release 1.11.4
### Major Features and Improvements
> FederatedML
* Unified key length configuration of encryption algorithm, update default key length to 2048.

> Bug-Fix
* Modify hessian computation of softmax cross entropy in SecureBoost, to align with LightGBM.
* Fix Model initialization error in Homo Neural Network predicting process.

## Release 1.11.3
### Major Features and Improvements
> FederatedML
Expand All @@ -14,7 +23,7 @@
* Hetero SecureBoost supports running multiple boosting rounds in complete secure mode with `complete_secure` option

> Bug-Fix
* Fix hessian computation of softmax cross entropy in SecureBoostt
* Fix hessian computation of softmax cross entropy in SecureBoost


## Release 1.11.1
Expand Down
2 changes: 1 addition & 1 deletion deploy/standalone-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export version={FATE version for this deployment}
example:

```bash
export version=1.11.3
export version=1.11.4
```

### 2.2 Pulling mirrors
Expand Down
4 changes: 2 additions & 2 deletions deploy/standalone-deploy/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
设置部署所需环境变量(注意, 通过以下方式设置的环境变量仅在当前终端会话有效, 若打开新的终端会话, 如重新登录或者新窗口, 请重新设置)

```bash
export version={本次部署的FATE版本号, 如1.11.3}
export version={本次部署的FATE版本号, 如1.11.4}
```

样例:

```bash
export version=1.11.3
export version=1.11.4
```

### 2.2 拉取镜像
Expand Down
2 changes: 1 addition & 1 deletion eggroll
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,30 @@
"component_parameters": {
"common": {
"intersection_0": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"intersection_1": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"hetero_feature_binning_0": {
"method": "optimal",
"bin_indexes": -1,
"optimal_binning_param": {
"metric_method": "iv",
"init_bucket_method": "quantile"
},
"encrypt_param": {
"key_length": 1024
}
},
"hetero_feature_selection_0": {
Expand Down Expand Up @@ -91,6 +104,9 @@
"init_param": {
"init_method": "zeros"
},
"encrypt_param": {
"key_length": 1024
},
"max_iter": 5,
"early_stop": "diff"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,30 @@
"component_parameters": {
"common": {
"intersection_0": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"intersection_1": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"hetero_feature_binning_0": {
"method": "optimal",
"bin_indexes": -1,
"optimal_binning_param": {
"metric_method": "iv",
"init_bucket_method": "quantile"
},
"encrypt_param": {
"key_length": 1024
}
},
"hetero_feature_selection_0": {
Expand Down Expand Up @@ -101,7 +114,8 @@
"ks"
],
"encrypt_param": {
"method": "Paillier"
"method": "Paillier",
"key_length": 1024
},
"early_stopping_rounds": 5,
"tree_param": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,30 @@
"component_parameters": {
"common": {
"intersection_0": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"intersection_1": {
"intersect_method": "raw"
"intersect_method": "rsa",
"rsa_params": {
"hash_method": "sha256",
"final_hash_method": "sha256",
"key_length": 1024
}
},
"hetero_feature_binning_0": {
"method": "optimal",
"bin_indexes": -1,
"optimal_binning_param": {
"metric_method": "iv",
"init_bucket_method": "quantile"
},
"encrypt_param": {
"key_length": 1024
}
},
"hetero_feature_selection_0": {
Expand Down Expand Up @@ -91,6 +104,9 @@
"init_param": {
"init_method": "zeros"
},
"encrypt_param": {
"key_length": 1024
},
"max_iter": 5,
"early_stop": "diff"
}
Expand Down
12 changes: 9 additions & 3 deletions examples/benchmark_quality/hetero_fast_sbt/fate-fast-sbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,21 @@ def main(config="../../config.yaml", param="./xgb_config_binary.yaml", namespace
with_label=False)

# data intersect component
intersect_0 = Intersection(name="intersection_0")
intersect_1 = Intersection(name="intersection_1")
intersect_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 1024})
intersect_1 = Intersection(
name="intersection_1",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

# secure boost component
hetero_fast_sbt_0 = HeteroFastSecureBoost(name="hetero_fast_sbt_0",
num_trees=param['tree_num'],
task_type=param['task_type'],
objective_param={"objective": param['loss_func']},
encrypt_param={"method": "Paillier"},
encrypt_param={"method": "Paillier", "key_length": 1024},
tree_param={"max_depth": param['tree_depth']},
validation_freqs=1,
subsample_feature_rate=1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ def main(config="../../config.yaml", param="./linr_config.yaml", namespace=""):
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

# define Intersection component
intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

param = {
"penalty": param["penalty"],
"max_iter": param["max_iter"],
"optimizer": param["optimizer"],
"learning_rate": param["learning_rate"],
"init_param": param["init_param"],
"encrypt_param": param["encrypt_param"],
"batch_size": param["batch_size"],
"alpha": param["alpha"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def main(config="../../config.yaml", param="./sshe_linr_config.yaml", namespace=
"optimizer": param["optimizer"],
"learning_rate": param["learning_rate"],
"init_param": param["init_param"],
"encrypt_param": param["encrypt_param"],
"batch_size": param["batch_size"],
"alpha": param["alpha"],
"early_stop": param["early_stop"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ alpha: 0.01
tol: 1e-4
init_param:
init_method: "zeros"
encrypt_param:
key_length: 1024
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ early_stop: "diff"
reveal_strategy: "respectively"
init_param:
init_method: "zeros"
encrypt_param:
key_length: 1024
8 changes: 7 additions & 1 deletion examples/benchmark_quality/hetero_lr/pipeline-lr-binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def main(config="../../config.yaml", param="./lr_config.yaml", namespace=""):
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

# define Intersection component
intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

lr_param = {
}
Expand All @@ -109,6 +112,9 @@ def main(config="../../config.yaml", param="./lr_config.yaml", namespace=""):
"init_param": {
"init_method": param.get("init_method", 'random_uniform'),
"random_seed": param.get("random_seed", 103)
},
"encrypt_param": {
"key_length": 1024
}
}
lr_param.update(config_param)
Expand Down
8 changes: 7 additions & 1 deletion examples/benchmark_quality/hetero_lr/pipeline-lr-multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def main(config="../../config.yaml", param="./vehicle_config.yaml", namespace=""
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

# define Intersection component
intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

lr_param = {
}
Expand All @@ -95,6 +98,9 @@ def main(config="../../config.yaml", param="./vehicle_config.yaml", namespace=""
"init_param": {
"init_method": param.get("init_method", 'random_uniform'),
"random_seed": param.get("random_seed", 103)
},
"encrypt_param": {
"key_length": 1024
}
}
lr_param.update(config_param)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def main(config="../../config.yaml", param="./lr_config.yaml", namespace=""):
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

# define Intersection component
intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

lr_param = {
}
Expand All @@ -107,6 +110,9 @@ def main(config="../../config.yaml", param="./lr_config.yaml", namespace=""):
"random_seed": param.get("random_seed", 103),
"fit_intercept": True
},
"encrypt_param": {
"key_length": 1024
},
"reveal_strategy": param.get("reveal_strategy", "respectively"),
"reveal_every_iter": True
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def main(config="../../config.yaml", param="./vehicle_sshe_lr_config.yaml", name
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

# define Intersection component
intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

lr_param = {
}
Expand All @@ -96,6 +99,9 @@ def main(config="../../config.yaml", param="./vehicle_sshe_lr_config.yaml", name
"random_seed": param.get("random_seed", 103),
"fit_intercept": True
},
"encrypt_param": {
"key_length": 1024
},
"reveal_strategy": param.get("reveal_strategy", "respectively"),
"reveal_every_iter": True
}
Expand Down
6 changes: 5 additions & 1 deletion examples/benchmark_quality/hetero_nn/fate-hetero_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def main(
role='host', party_id=host).component_param(
with_label=False)

intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

guest_bottom, host_bottom, interactive_layer, top_layer = build(
param, param['shape1'], param['shape2'])
Expand All @@ -128,6 +131,7 @@ def main(
interactive_layer_lr=param["learning_rate"],
batch_size=param["batch_size"],
seed=100,
encrypt_param={"key_length": 1024},
dataset=ds_param)
guest_nn_0 = hetero_nn_0.get_party_instance(role='guest', party_id=guest)
host_nn_0 = hetero_nn_0.get_party_instance(role='host', party_id=host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def main(config="./config.yaml", param="./hetero_nn_breast_config.yaml", namespa
data_transform_0.get_party_instance(role='guest', party_id=guest).component_param(with_label=True)
data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)

intersection_0 = Intersection(name="intersection_0")
intersection_0 = Intersection(
name="intersection_0",
intersect_method="rsa",
rsa_params={"hash_method": "sha256", "final_hash_method": "sha256", "key_length": 2048})

guest_input_shape = param['guest_input_shape']
host_input_shape = param['host_input_shape']
Expand Down Expand Up @@ -78,7 +81,7 @@ def main(config="./config.yaml", param="./hetero_nn_breast_config.yaml", namespa

hetero_nn_0 = HeteroNN(name="hetero_nn_0", epochs=param["epochs"],
interactive_layer_lr=param["learning_rate"], batch_size=param["batch_size"],
early_stop="diff")
early_stop="diff", encrypt_param={"key_length": 1024})
guest_nn_0 = hetero_nn_0.get_party_instance(role='guest', party_id=guest)
guest_nn_0.add_bottom_model(bottom_model_guest)
guest_nn_0.add_top_model(top_model_guest)
Expand Down
Loading

0 comments on commit 87dd4f6

Please sign in to comment.