-
Notifications
You must be signed in to change notification settings - Fork 2
/
param_parser.py
146 lines (113 loc) · 4.83 KB
/
param_parser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
"""Argument parsing."""
import argparse
def parameter_parser():
"""
A method to parse up command line parameters.
The default hyperparameters give a high performance model without grid search.
"""
parser = argparse.ArgumentParser()
parser.add_argument("--data",
nargs="?",
default="../input/qed/positive/train/",
help="Folder with training graph jsons.")
parser.add_argument("--property",
type = str,
default= 'qed')
parser.add_argument("--use_mi",
action = 'store_true')
parser.add_argument("--unsupervised",
action = 'store_true',
help="Folder with training graph jsons.")
parser.add_argument("--train_percent",
type = float,
default= 0.85,
help="Folder with training graph jsons.")
parser.add_argument("--validate_percent",
type = float,
default= 0.05,
help="Folder with training graph jsons.")
parser.add_argument("--subgraph_const",
type = float,
default= 0.8 ,
help="Folder with training graph jsons.")
parser.add_argument("--first-gcn-dimensions",
type=int,
default=16,
help="Filters (neurons) in 1st convolution. Default is 32.")
parser.add_argument("--second-gcn-dimensions",
type=int,
default=16,
help="Filters (neurons) in 2nd convolution. Default is 16.")
parser.add_argument("--first-dense-neurons",
type=int,
default=16,
help="Neurons in SAGE aggregator layer. Default is 16.")
parser.add_argument("--second-dense-neurons",
type=int,
default=2,
help="SAGE attention neurons. Default is 8.")
parser.add_argument("--epochs",
type=int,
default=2,
help="Number of epochs. Default is 10.")
parser.add_argument("--learning-rate",
type=float,
default=0.001,
help="Learning rate. Default is 0.01.")
parser.add_argument("--weight-decay",
type=float,
default=5*10**-5,
help="Adam weight decay. Default is 5*10^-5.")
parser.add_argument("--gamma",
type=float,
default=10**-5,
help="Attention regularization coefficient. Default is 10^-5.")
parser.add_argument("--save",
type=str,
default='../test_results/qed_positive/',
help="save results .")
parser.add_argument("--batch_size",
type=int,
default= 128,
help="batch_size")
parser.add_argument("--cls_hidden_dimensions",
type=int,
default= 4,
help="classifier hidden dims")
parser.add_argument("--dis_hidden_dimensions",
type=int,
default= 4,
help="classifier hidden dims")
parser.add_argument("--mi_weight",
type=float,
default= 0.0001,
help="classifier hidden dims")
parser.add_argument("--con_weight",
type=float,
default= 5,
help="classifier hidden dims")
parser.add_argument("--inner_loop",
type=int,
default= 50,
help="classifier hidden dims")
parser.add_argument("--noise_scale",
type=float,
default= 0.1,
help="classifier hidden dims")
parser.add_argument("--warm_up",
type=int,
default= 1,
help="classifier hidden dims")
parser.add_argument("--gnn",
type=str,
default= 'GCN',
help="classifier hidden dims")
parser.add_argument("--training_dir",
type=str,
default= 'training/',
help="classifier hidden dims")
parser.add_argument("--testing_dir",
type=str,
default= 'testing/',
help="classifier hidden dims")
return parser.parse_args()