Skip to content

Commit

Permalink
ADD:demo for win
Browse files Browse the repository at this point in the history
  • Loading branch information
scharoun committed Jun 10, 2017
1 parent c402e12 commit 5bd4628
Show file tree
Hide file tree
Showing 52 changed files with 3,078 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config/model/ffm.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,
data {
train {
Expand Down
2 changes: 1 addition & 1 deletion config/model/fm.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,
data {
train {
Expand Down
2 changes: 1 addition & 1 deletion config/model/gbdt.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# local filesystem : "file:///",
# hdfs filesystem : "hdfs://host"
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

# "gradient_boosting"(default), "random_forest"
Expand Down
2 changes: 1 addition & 1 deletion config/model/gbhmlr.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion config/model/gbhsdt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion config/model/gbmlr.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion config/model/gbsdt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion config/model/linear.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion config/model/multiclass_linear.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion demo/gbdt/regression_l2/local_gbdt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion demo/gbsdt/binary_classification/gbsdt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs_scheme : "file:///",
fs_scheme : "local",
verbose : false,

data {
Expand Down
2 changes: 1 addition & 1 deletion demo/linear/binary_classification/linear.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ feature {


model {
data_path : "demo/linear/regression/lr.model",
data_path : "demo/linear/binary_classification/lr.model",
delim : ",",
need_dict : false,
dict_path : "",
Expand Down
2 changes: 1 addition & 1 deletion demo/linear/regression/linear.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ feature {


model {
data_path : "demo/linear/binary_classification/l2.model",
data_path : "demo/linear/regression/l2.model",
delim : ",",
need_dict : false,
dict_path : "",
Expand Down
139 changes: 139 additions & 0 deletions demo/win/ffm/binary_classification/ffm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
fs_scheme : "local",
verbose : false,
data {
train {
data_path : "demo/data/ytklearn/agaricus.train.ytklearn",
max_error_tol : 0
},

test {
data_path : "demo/data/ytklearn/agaricus.test.ytklearn",
max_error_tol : 0
},

delim {
x_delim : "###",
y_delim : ",",
features_delim : ",",
feature_name_val_delim : ":",
field_delim : "@"
},

// ["[email protected]","[email protected]",...]
y_sampling : [],
assigned : false,
unassigned_mode : "lines_avg" // "files_avg"
},

feature {
feature_hash {
need_feature_hash : false,
bucket_size : 1000000,
seed : 39916801,
feature_prefix : "hash_"
},

transform {
switch_on : false,
// "standardization", "scale_range"
mode : "standardization",
scale_range {
min : -1,
max : 1
},

include_features : [],
exclude_features : []
},

filter_threshold : 0
},

model {
data_path : "demo/win/ffm/binary_classification/ffm.model",
delim : ",",
need_dict : false,
dict_path : "",
field_dict_path : "demo/win/ffm/binary_classification/field.dict",
dump_freq : 50,
need_bias : true,
bias_feature_name : "_bias_",
continue_train : false
},

loss {
loss_function : "sigmoid",
evaluate_metric : ["auc"],
just_evaluate : false,
regularization : {
l1 : [5.28e-9, 5.28e-9],
l2 : [5.28e-7, 5.28e-7]
}
},

optimization {
optimizer : "line_search",

line_search {

mode : "wolfe",

backtracking : {
step_decr : 0.5,
step_incr : 2.1,
max_iter : 55,
min_step : 1e-16,
max_step : 1e18,
c1 : 1e-4,
c2 : 0.9
}

lbfgs {
m : 12,
convergence : {
max_iter : 100,
eps : 1e-3
}
}
}
},

hyper {
switch_on : false,
restart : true,
mode : "hoag",

hoag {
init_step : 1.0,
step_decr_factor : 0.7,
test_loss_reduce_limit : 1e-5,
outer_iter : 10,
l1 : [0.0, 0.0],
l2 : [5.28e-7, 5.28e-7]
},

grid {
l1 : [1e-9, 1e-6, 5, 1e-9, 1e-6, 5],
l2 : [1e-8, 1e-5, 5, 1e-8, 1e-5, 5]
}

},

random {
mode : "normal",
seed : 111111,
normal {
mean : 0.0,
std : 0.01
},

uniform {
range_start : -0.01,
range_end : 0.01
},
},

k : [1,4],
bias_need_latent_factor : false


114 changes: 114 additions & 0 deletions demo/win/ffm/binary_classification/field.dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
88
110
111
112
113
115
116
117
90
118
91
119
92
93
94
95
96
10
11
99
12
13
15
16
17
18
19
120
121
1
122
123
2
124
3
125
4
126
5
6
7
8
9
20
21
22
23
24
25
26
27
28
29
30
31
32
34
36
37
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
58
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
100
101
102
105
106
107
80
108
81
109
82
83
84
85
86
87
30 changes: 30 additions & 0 deletions demo/win/ffm/binary_classification/win_local_optimizer.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
echo on
@Rem thread number
set thread_num=6

@Rem use current machine as master
FOR /F "usebackq" %%i IN (`hostname`) DO SET master_host=%%i
echo %master_host%

@Rem if you run more than one training tasks on the same host at the same time,
@Rem different tasks must have different ports!
set master_port=61235

@Rem model name(linear, fm, ffm, gbdt, gbmlr, gbsdt, gbhmlr, gbhsdt, multiclass_linear)
set model_name=ffm

@Rem model config
set properties_path=demo/win/ffm/binary_classification/%model_name%.conf

@Rem train/test line python transform switch & script
set transform=false
set transform_script_path=bin/transform.py

cd ../../../../
@Rem start ytk-mp4j master, default max memory is 512m
@start /b cmd /c java -Xmx512m -cp lib/* -Dlog4j.configuration=file:config/log4j_master_win.properties com.fenbi.mp4j.comm.CommMaster 1 %master_port%

@Rem start windows train local worker, default max memory is 1000m
@start /b cmd /c java -Xmx1000m -XX:-OmitStackTraceInFastThrow -cp lib/* -Dlog4j.configuration=file:config/log4j_slave_win.properties com.fenbi.ytklearn.worker.LocalTrainWorker %model_name% %properties_path% %transform_script_path% %transform% user %master_host% %master_port% %thread_num%

pause
Loading

0 comments on commit 5bd4628

Please sign in to comment.