MCPcopy Create free account

hub / github.com/DeepGraphLearning/KnowledgeGraphEmbedding / functions

Functions29 in github.com/DeepGraphLearning/KnowledgeGraphEmbedding

↓ 5 callersFunctionlog_metrics
Print the evaluation logs
codes/run.py:153
↓ 4 callersMethodtest_step
Evaluate the model on test or valid datasets
codes/model.py:314
↓ 3 callersFunctionread_triple
Read triples and map them into ids.
codes/run.py:119
↓ 2 callersMethodone_shot_iterator
Transform a PyTorch Dataloader into python iterator
codes/dataloader.py:178
↓ 2 callersFunctionsave_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 callersMethodcount_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 callersMethodget_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 callersFunctionmain
(args)
codes/run.py:161
↓ 1 callersFunctionoverride_config
Override model and data configuration
codes/run.py:73
↓ 1 callersFunctionparse_args
(args=None)
codes/run.py:23
↓ 1 callersFunctionset_logger
Write logs to checkpoint and console
codes/run.py:130
↓ 1 callersMethodtrain_step
A single train step. Apply back-propation and return the loss
codes/model.py:251
MethodComplEx
(self, head, relation, tail, mode)
codes/model.py:183
MethodDistMult
(self, head, relation, tail, mode)
codes/model.py:174
MethodRotatE
(self, head, relation, tail, mode)
codes/model.py:200
MethodTransE
(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
Methodcollate_fn
(data)
codes/dataloader.py:69
Methodcollate_fn
(data)
codes/dataloader.py:156
Methodforward
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
MethodpRotatE
(self, head, relation, tail, mode)
codes/model.py:230