Skip to content

Commit 75be1fc

Browse files
committed
Add TransH
1 parent ffd2f60 commit 75be1fc

File tree

3 files changed

+763
-3
lines changed

3 files changed

+763
-3
lines changed

transE_Bernoulli_pytorch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def __init__(self):
115115
validTotal, validList, validDict = loadTriple('./data/' + args.dataset, 'valid2id.txt')
116116
tripleTotal, tripleList, tripleDict = loadTriple('./data/' + args.dataset, 'triple2id.txt')
117117
with open(os.path.join('./data/', args.dataset, 'head_tail_proportion.pkl'), 'rb') as fr:
118-
tail_per_head = pickle.load(fr)
119-
head_per_tail = pickle.load(fr)
118+
tail_per_head = pickle.load(fr)
119+
head_per_tail = pickle.load(fr)
120120

121121
config = Config()
122122
config.dataset = args.dataset
@@ -317,7 +317,7 @@ def __init__(self):
317317
torch.save(model, os.path.join('./model/' + args.dataset, filename))
318318
else:
319319
meanrank_not_decrease_time += 1
320-
# If the result hasn't improved for consecutive 5 epochs, decrease learning rate
320+
# If the result hasn't improved for consecutive 5 evaluations, decrease learning rate
321321
if meanrank_not_decrease_time == 5:
322322
lr_decrease_time += 1
323323
if lr_decrease_time == config.early_stopping_round:

0 commit comments

Comments
 (0)