-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
22 lines (20 loc) · 991 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import configparser
class Config(object):
def __init__(self, config_file):
conf = configparser.ConfigParser()
try:
conf.read(config_file)
except:
print("loading config: %s failed" % (config_file))
#Hyper-parameter
self.model_num = conf.getint("Model_Setup", "model_num")
self.relation_select = conf.get("Model_Setup", "relation_select")
self.random_seed = conf.get("Model_Setup", "random_seed")
self.epochs = conf.getint("Model_Setup", "epochs")
self.lr = conf.getfloat("Model_Setup", "lr")
self.weight_decay = conf.getfloat("Model_Setup", "weight_decay")
self.hidden_dimension = conf.getint("Model_Setup", "hidden_dimension")
self.dropout = conf.getfloat("Model_Setup", "dropout")
self.alpha = conf.getfloat("Model_Setup", "alpha")
self.beta = conf.getfloat("Model_Setup", "beta")
self.gamma = conf.getfloat("Model_Setup", "gamma")