Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DeepGraphLearning/KnowledgeGraphEmbedding
/ functions
Functions
29 in github.com/DeepGraphLearning/KnowledgeGraphEmbedding
⨍
Functions
29
◇
Types & classes
4
↓ 5 callers
Function
log_metrics
Print the evaluation logs
codes/run.py:153
↓ 4 callers
Method
test_step
Evaluate the model on test or valid datasets
codes/model.py:314
↓ 3 callers
Function
read_triple
Read triples and map them into ids.
codes/run.py:119
↓ 2 callers
Method
one_shot_iterator
Transform a PyTorch Dataloader into python iterator
codes/dataloader.py:178
↓ 2 callers
Function
save_model
Save the parameters of the model and the optimizer, as well as some other variables such as step and learning_rate
codes/run.py:90
↓ 1 callers
Method
count_frequency
Get frequency of a partial triple like (head, relation) or (relation, tail) The frequency will be used for subsampling like word2vec
codes/dataloader.py:77
↓ 1 callers
Method
get_true_head_and_tail
Build a dictionary of true triples that will be used to filter these true triples for negative sampling
codes/dataloader.py:96
↓ 1 callers
Function
main
(args)
codes/run.py:161
↓ 1 callers
Function
override_config
Override model and data configuration
codes/run.py:73
↓ 1 callers
Function
parse_args
(args=None)
codes/run.py:23
↓ 1 callers
Function
set_logger
Write logs to checkpoint and console
codes/run.py:130
↓ 1 callers
Method
train_step
A single train step. Apply back-propation and return the loss
codes/model.py:251
Method
ComplEx
(self, head, relation, tail, mode)
codes/model.py:183
Method
DistMult
(self, head, relation, tail, mode)
codes/model.py:174
Method
RotatE
(self, head, relation, tail, mode)
codes/model.py:200
Method
TransE
(self, head, relation, tail, mode)
codes/model.py:165
Method
__getitem__
(self, idx)
codes/dataloader.py:27
Method
__getitem__
(self, idx)
codes/dataloader.py:133
Method
__init__
(self, triples, nentity, nrelation, negative_sample_size, mode)
codes/dataloader.py:13
Method
__init__
(self, triples, all_true_triples, nentity, nrelation, mode)
codes/dataloader.py:122
Method
__init__
(self, dataloader_head, dataloader_tail)
codes/dataloader.py:164
Method
__init__
(self, model_name, nentity, nrelation, hidden_dim, gamma, double_entity_embedding=False, dou
codes/model.py:22
Method
__len__
(self)
codes/dataloader.py:24
Method
__len__
(self)
codes/dataloader.py:130
Method
__next__
(self)
codes/dataloader.py:169
Method
collate_fn
(data)
codes/dataloader.py:69
Method
collate_fn
(data)
codes/dataloader.py:156
Method
forward
Forward function that calculate the score of a batch of triples. In the 'single' mode, sample is a batch of triple. In the 'h
codes/model.py:71
Method
pRotatE
(self, head, relation, tail, mode)
codes/model.py:230