-
Notifications
You must be signed in to change notification settings - Fork 0
/
KarateClub.py
49 lines (38 loc) · 993 Bytes
/
KarateClub.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
from os.path import join
BASENAME = "KarateClub"
def get_torchbiggraph_config():
model = join("/data/models", BASENAME)
graphs = join("data/graphs", BASENAME)
config = dict(
# I/O data
entity_path=model,
# where to store learnt edges
edge_paths=[
join(graphs, "train_partitioned"),
join(graphs, "test_partitioned"),
],
checkpoint_path=model,
# Graph structure
entities={
'link': {'num_partitions': 1},
},
relations=[{
'name': 'follow',
'lhs': 'link',
'rhs': 'link',
'operator': 'none',
}],
verbose=True,
dynamic_relations=False,
# Scoring model
dimension=128,
global_emb=False,
# Training
num_epochs=100,
num_uniform_negs=50,
loss_fn='softmax',
lr=0.01,
# Misc
hogwild_delay=2,
)
return config