Skip to content

Commit

Permalink
update examples: remove deprecated param, fix linear regression using…
Browse files Browse the repository at this point in the history
… optimizer sqn error, add sqn examples of linr

Signed-off-by: mgqa34 <[email protected]>
  • Loading branch information
mgqa34 committed Feb 24, 2022
1 parent c2528ef commit a361571
Show file tree
Hide file tree
Showing 47 changed files with 301 additions and 581 deletions.
3 changes: 0 additions & 3 deletions doc/federatedml_component/logistic_regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ which HE and Secret-Sharing hybrid protocol is included.
> > - nesterov\_momentum\_sgd
> > Nesterov Momentum
> >
> > - sqn
> > stochastic quansi-newton. More details is available in this
> > [A Quasi-Newton Method Based Vertical Federated Learning Framework for Logistic Regression](https://arxiv.org/abs/1912.00513v2).
>
> 5. Three converge criteria:
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"conf": "./test_hetero_linr_predict_job_conf.json",
"dsl": "./test_hetero_linr_predict_job_dsl.json"
},
"linr-train-sqn": {
"conf": "./test_hetero_linr_train_sqn_job_conf.json",
"dsl": "./test_hetero_linr_train_sqn_job_dsl.json"
},
"linr-warm-start": {
"conf": "./test_hetero_linr_warm_start_job_conf.json",
"dsl": "./test_hetero_linr_warm_start_job_dsl.json"
Expand Down Expand Up @@ -64,6 +68,10 @@
"conf": "./test_hetero_linr_train_sparse_job_conf.json",
"dsl": "./test_hetero_linr_train_sparse_job_dsl.json"
},
"linr_sparse_sqn": {
"conf": "./test_hetero_linr_train_sparse_sqn_job_conf.json",
"dsl": "./test_hetero_linr_train_sparse_sqn_job_dsl.json"
},
"linr_sample_weight": {
"conf": "./test_hetero_linr_train_sample_weight_job_conf.json",
"dsl": "./test_hetero_linr_train_sample_weight_job_dsl.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"cv_param": {
"n_splits": 5,
"shuffle": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"cv_param": {
"n_splits": 5,
"shuffle": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"decay": 0.0,
"decay_sqrt": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"decay": 0.0,
"decay_sqrt": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"decay": 0.0,
"decay_sqrt": false,
"floating_point_precision": 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
},
"max_iter": 20,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"decay": 0.0,
"decay_sqrt": false,
"floating_point_precision": 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
},
"max_iter": 2,
"early_stop": "weight_diff",
"encrypted_mode_calculator_param": {
"mode": "fast"
},
"decay": 0.0,
"decay_sqrt": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"role": {
"arbiter": [
9999
10000
],
"host": [
10000
Expand All @@ -16,68 +16,67 @@
]
},
"component_parameters": {
"common": {
"data_transform_0": {
"missing_fill": true,
"outlier_replace": false,
"output_format": "sparse"
},
"hetero_linr_0": {
"penalty": "L2",
"tol": 0.001,
"alpha": 0.01,
"optimizer": "sgd",
"batch_size": 100,
"learning_rate": 0.15,
"init_param": {
"init_method": "zeros"
},
"sqn_param": {
"update_interval_L": 3,
"memory_M": 5,
"sample_size": 5000,
"random_seed": null
},
"max_iter": 2,
"early_stop": "weight_diff",
"decay": 0.0,
"decay_sqrt": false
},
"evaluation_0": {
"eval_type": "regression",
"pos_label": 1
}
},
"role": {
"host": {
"guest": {
"0": {
"data_transform_0": {
"with_label": false
"with_label": true,
"label_name": "motor_speed",
"label_type": "float"
},
"reader_0": {
"table": {
"name": "breast_hetero_host",
"name": "motor_hetero_guest",
"namespace": "experiment"
}
}
}
},
"guest": {
"host": {
"0": {
"data_transform_0": {
"with_label": true
"with_label": false
},
"reader_0": {
"table": {
"name": "breast_hetero_guest",
"name": "motor_hetero_host",
"namespace": "experiment"
}
}
}
}
},
"common": {
"data_transform_0": {
"output_format": "sparse"
},
"hetero_lr_0": {
"penalty": "L2",
"tol": 0.0001,
"alpha": 1e-05,
"optimizer": "sqn",
"batch_size": 5000,
"learning_rate": 0.15,
"init_param": {
"init_method": "zeros"
},
"max_iter": 30,
"early_stop": "diff",
"cv_param": {
"n_splits": 5,
"shuffle": false,
"random_seed": 103,
"need_cv": false
},
"decay": 0.3,
"decay_sqrt": true,
"sqn_param": {
"update_interval_L": 3,
"memory_M": 5,
"sample_size": 5000,
"random_seed": null
}
},
"evaluation_0": {
"eval_type": "binary"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
]
}
},
"hetero_lr_0": {
"module": "HeteroLR",
"hetero_linr_0": {
"module": "HeteroLinR",
"input": {
"data": {
"train_data": [
Expand All @@ -64,7 +64,7 @@
"input": {
"data": {
"data": [
"hetero_lr_0.data"
"hetero_linr_0.data"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"role": {
"arbiter": [
9999
10000
],
"host": [
10000
Expand All @@ -16,68 +16,64 @@
]
},
"component_parameters": {
"common": {
"hetero_linr_0": {
"penalty": "L2",
"tol": 0.001,
"alpha": 0.01,
"optimizer": "sqn",
"batch_size": -1,
"learning_rate": 0.15,
"init_param": {
"init_method": "zeros"
},
"sqn_param": {
"update_interval_L": 3,
"memory_M": 5,
"sample_size": 5000,
"random_seed": null
},
"max_iter": 20,
"early_stop": "weight_diff",
"decay": 0.0,
"decay_sqrt": false,
"floating_point_precision": 23
},
"evaluation_0": {
"eval_type": "regression",
"pos_label": 1
}
},
"role": {
"host": {
"0": {
"data_transform_0": {
"with_label": false
},
"reader_0": {
"table": {
"name": "breast_hetero_host",
"name": "motor_hetero_host",
"namespace": "experiment"
}
},
"data_transform_0": {
"with_label": false
}
}
},
"guest": {
"0": {
"data_transform_0": {
"with_label": true
},
"reader_0": {
"table": {
"name": "breast_hetero_guest",
"name": "motor_hetero_guest",
"namespace": "experiment"
}
},
"data_transform_0": {
"with_label": true,
"label_name": "motor_speed",
"label_type": "float",
"output_format": "dense"
}
}
}
},
"common": {
"data_transform_0": {
"output_format": "dense"
},
"hetero_lr_0": {
"penalty": "L2",
"tol": 0.0001,
"alpha": 1e-05,
"optimizer": "sqn",
"batch_size": 5000,
"learning_rate": 0.15,
"init_param": {
"init_method": "zeros"
},
"max_iter": 10,
"early_stop": "diff",
"cv_param": {
"n_splits": 3,
"shuffle": false,
"random_seed": 103,
"need_cv": false
},
"decay": 0.3,
"decay_sqrt": true,
"sqn_param": {
"update_interval_L": 3,
"memory_M": 5,
"sample_size": 5000,
"random_seed": null
}
},
"evaluation_0": {
"eval_type": "binary"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
]
}
},
"hetero_lr_0": {
"module": "HeteroLR",
"hetero_linr_0": {
"module": "HeteroLinR",
"input": {
"data": {
"train_data": [
Expand All @@ -58,21 +58,6 @@
"model"
]
}
},
"evaluation_0": {
"module": "Evaluation",
"input": {
"data": {
"data": [
"hetero_lr_0.data"
]
}
},
"output": {
"data": [
"data"
]
}
}
}
}
Loading

0 comments on commit a361571

Please sign in to comment.