MCPcopy Create free account

hub / github.com/bxshi/ConMask / functions

Functions158 in github.com/bxshi/ConMask

↓ 21 callersFunctioncount_line
(file_path)
ndkgc/utils/__init__.py:6
↓ 14 callersFunctionentity_content_embedding_lookup
Lookup entity word embeddings given a flatten 1-D entity id list and content lookup table :param entities: Must be a 1-D entity vector :para
ndkgc/ops/content.py:83
↓ 13 callersFunctionget_lookup_table
(element_file_path, oov_buckets, size=None, device='/cpu:0', name='lookup_table')
ndkgc/ops/content.py:31
↓ 13 callersFunctionnormalized_lookup
(params, ids, name=None)
ndkgc/ops/lookup.py:4
↓ 12 callersMethoddist
(self, h, r, t)
ndkgc/models/dkrl.py:204
↓ 12 callersMethodeval_helper
(scores, test_target_idx, true_target_idx)
ndkgc/models/content_model.py:1159
↓ 10 callersFunctionavg_content
Content embedding without padding embeddings Works with 3-D tensor [?, content_len, embedding_size] and 4-D tensor [?, ?, content_len, emb
ndkgc/ops/content.py:110
↓ 10 callersFunctionload_filtered_targets
(idx_file, value_file)
ndkgc/utils/__init__.py:291
↓ 10 callersFunctionload_relation_specific_targets
Based on training file, generate a subset of targets for each relationship. The assumption is if entity has relationship R before
ndkgc/utils/__init__.py:271
↓ 9 callersFunctionload_list
(file_path)
ndkgc/utils/__init__.py:33
↓ 9 callersFunctionload_train_entities
(entity_file, avoid_entity_file)
ndkgc/utils/__init__.py:44
↓ 7 callersFunctionload_content
(content_file_path, entities, max_content_len=256)
ndkgc/utils/__init__.py:93
↓ 7 callersMethodtranslate_triple
(self, heads, tails, rels, device, reuse=True)
ndkgc/models/content_averaging_model.py:717
↓ 7 callersMethodtranslate_triple
(self, heads, tails, rels, device, reuse=True)
ndkgc/models/content_model.py:716
↓ 6 callersMethod_combine_head_relation
:param transformed_heads: [?, ?, word_dim] :param transformed_rels: [?, word_dim] :param reuse: :param device:
ndkgc/models/content_model.py:681
↓ 6 callersFunctionload_triples
(file_path, entities=None, relations=None)
ndkgc/utils/__init__.py:66
↓ 5 callersMethod__conv_layers
:param content: [batch_size, ?, word_embedding_size] :param content_len: [batch_size] :return:
ndkgc/models/dkrl.py:121
↓ 5 callersFunctioneval_helper
(is_test=True)
ndkgc/models/content_averaging_model.py:1777
↓ 5 callersFunctionget_target_entities
Change this to return a SparseTensor :param entity: entity must be a 1-D vector with one element? :param relation: :param targets_lookup
ndkgc/ops/corruption.py:75
↓ 4 callersMethod_transform_head_entity
Generate head entity representation using given entity ids. :param heads: :param reuse: :param device: :param name:
ndkgc/models/content_averaging_model.py:548
↓ 4 callersFunctioncontent_lookup
Lookup a single entity's content from `content`, and convert words into ids using vocab_table. :param content: A 1-D string matrix :param vo
ndkgc/ops/content.py:40
↓ 4 callersFunctiondescription_and_title_lookup
A convenience function for looking up both content and title embeddings. This will preserve the input entity shape. So the output shape would be
ndkgc/ops/content.py:142
↓ 4 callersMethodeval_helper
(scores, test_target_idx, true_target_idx)
ndkgc/models/content_averaging_model.py:1156
↓ 4 callersMethodinference
(self, triples, head_content_ids, head_content_len, tail_content_ids, tail_content_len, vari
ndkgc/models/dkrl.py:210
↓ 4 callersFunctionload_target_file
(file_path)
ndkgc/utils/__init__.py:56
↓ 3 callersMethod__initialize_model
(self)
ndkgc/models/dkrl.py:267
↓ 3 callersMethod_combine_head_relation
:param transformed_heads: [?, ?, word_dim] :param transformed_rels: [?, word_dim] :param reuse: :param device:
ndkgc/models/content_averaging_model.py:681
↓ 3 callersMethod_predict
:param combined_head_rel: [?, ?, word_dim] :param tails: [?, ?, word_dim] :param reuse: :param device: :para
ndkgc/models/content_averaging_model.py:699
↓ 3 callersMethod_predict
(self, head_content, head_content_avg, head_title, rel_title, tail_content, tail_content_avg,
ndkgc/models/fcn_model_v2.py:130
↓ 3 callersMethod_predict
:param combined_head_rel: [?, ?, word_dim] :param tails: [?, ?, word_dim] :param reuse: :param device: :para
ndkgc/models/content_model.py:699
↓ 3 callersMethod_predict
(self, head_content, head_title, tail_content, tail_title, device='/cpu:0', reuse=True, name=None)
ndkgc/models/cnn_model.py:98
↓ 3 callersMethod_transform_head_entity
This is used to extract entity description and titles. :param heads: [?, ?] <- due to evaluation, sometimes heads will be (1, ?) but
ndkgc/models/fcn_model_v2.py:333
↓ 3 callersMethod_transform_head_entity
Generate head entity representation using given entity ids. :param heads: :param reuse: :param device: :param name:
ndkgc/models/content_model.py:548
↓ 3 callersMethod_transform_head_entity
This is used to extract entity description and titles. :param heads: [?, ?] <- due to evaluation, sometimes heads will be (1, ?) but
ndkgc/models/cnn_model.py:220
↓ 3 callersMethod_transform_relation
:param rels: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/content_averaging_model.py:642
↓ 3 callersMethod_transform_relation
:param rels: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/fcn_model_v2.py:243
↓ 3 callersMethod_transform_relation
:param rels: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/content_model.py:642
↓ 3 callersMethod_transform_relation
:param rels: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/cnn_model.py:132
↓ 3 callersMethod_transform_tail_entity
(self, tails, transformed_rels, reuse=True, device='/cpu:0', name=None)
ndkgc/models/fcn_model_v2.py:346
↓ 3 callersMethod_transform_tail_entity
:param tails: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/content_model.py:595
↓ 3 callersMethod_transform_tail_entity
(self, tails, transformed_rels, reuse=True, device='/cpu:0', name=None)
ndkgc/models/cnn_model.py:233
↓ 3 callersFunctionavg_grads
(tower_grads)
ndkgc/ops/multigpu.py:4
↓ 3 callersMethodcreate
(self, device='/cpu:0')
ndkgc/models/content_model.py:782
↓ 3 callersMethodinitialize
(self, session)
ndkgc/models/content_model.py:798
↓ 3 callersFunctionmultiple_content_lookup
:param content: :param vocab_table: :param ids: :param name: :return: 2-D [batch_size, max_length_in_batch] content id matrix,
ndkgc/ops/content.py:57
↓ 3 callersFunctionnormalized_embedding
(embedding, name=None)
ndkgc/ops/lookup.py:20
↓ 3 callersMethodtrain_ops
(self, lr=0.01, lr_decay=False, num_epoch=10, batch_size=200, sampled_true=1, sampled_false=
ndkgc/models/content_model.py:801
↓ 2 callersMethod__transform_entity
This is the transformation function for both head and tail entities :param ents: :param transformed_rels: :param reuse:
ndkgc/models/fcn_model_v2.py:282
↓ 2 callersMethod__transform_entity
This is the transformation function for both head and tail entities :param ents: :param transformed_rels: :param reuse:
ndkgc/models/cnn_model.py:171
↓ 2 callersMethod_conv_helper
(self, x, scope)
ndkgc/models/dkrl.py:553
↓ 2 callersFunction_corrupt_single_entity_helper
Corrupt the entity by __sampling from [0, max_range] and not in the true target set. :param triple: :param all_triples: :param corrupt_t
ndkgc/ops/corruption.py:12
↓ 2 callersMethod_entity_word_averaging
Calculate the averaging embedding of given entities. :param content_embedding: 3 dimension tensor with shape [?, embedding_size] :pa
ndkgc/models/content_averaging_model.py:510
↓ 2 callersMethod_entity_word_averaging
Calculate the averaging embedding of given entities. :param content_embedding: 3 dimension tensor with shape [?, embedding_size] :pa
ndkgc/models/content_model.py:505
↓ 2 callersMethod_sanity_check
Run a series of sanity check functions to validate the model. :param entity_dict: A dictionary of {entity_str_name : entity_numerical_id}
ndkgc/models/content_averaging_model.py:124
↓ 2 callersMethod_sanity_check
Run a series of sanity check functions to validate the model. :param entity_dict: A dictionary of {entity_str_name : entity_numerical_id}
ndkgc/models/content_model.py:120
↓ 2 callersMethod_transform_tail_entity
:param tails: Any shape :param reuse: :param device: :param name: :return:
ndkgc/models/content_averaging_model.py:595
↓ 2 callersFunctioncorrupt_single_entity_w_multiple_targets
Generate a set of training triples using a correct one. Input triple is a string triple, and the output elements are all numerical ids :par
ndkgc/ops/corruption.py:113
↓ 2 callersFunctionhead_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/fcn_model_v2.py:652
↓ 2 callersFunctionhead_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/cnn_model.py:495
↓ 2 callersFunctionload_manual_evaluation_file_by_rel
Load normal head, tail, rel files, divide them into dicts { relation : { head : [tails] } } We also skip
ndkgc/utils/__init__.py:189
↓ 2 callersMethodload_static_variables
(self, sess)
ndkgc/models/dkrl.py:160
↓ 2 callersFunctionload_vocab_embedding
(embedding_path, vocab_dict, oov)
ndkgc/utils/__init__.py:127
↓ 2 callersFunctionload_vocab_file
(vocab_file_path)
ndkgc/utils/__init__.py:118
↓ 2 callersFunctionmask_content_embedding
Calculate the similarity :param entity_embeddings: [?, n_entities, content_length, word_embed_size] :param relation_embeddings: [batch_size,
ndkgc/ops/content.py:209
↓ 2 callersMethodranking_loss
(self, positive_dist, negative_dist)
ndkgc/models/dkrl.py:207
↓ 2 callersFunctiontail_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/fcn_model_v2.py:877
↓ 2 callersFunctiontail_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/cnn_model.py:685
↓ 1 callersMethod_create_embeddings
Create all embedding matrices in this function. :param device: The storage device of all the embeddings. If you are
ndkgc/models/content_averaging_model.py:424
↓ 1 callersMethod_create_embeddings
Create all embedding matrices in this function. :param device: The storage device of all the embeddings. If you are
ndkgc/models/content_model.py:419
↓ 1 callersMethod_create_nontrainable_variables
Non trainable variables/constants. The variables created in this function will not be stored in the checkpoints. If the input data c
ndkgc/models/content_averaging_model.py:236
↓ 1 callersMethod_create_nontrainable_variables
Non trainable variables/constants. The variables created in this function will not be stored in the checkpoints. If the input data c
ndkgc/models/content_model.py:231
↓ 1 callersMethod_create_training_input_pipeline
Create an input pipeline that provides pre-processed, sampled training data The pipeline will be stored on CPU because it can not be opt
ndkgc/models/content_averaging_model.py:441
↓ 1 callersMethod_create_training_input_pipeline
Create an input pipeline that provides pre-processed, sampled training data The pipeline will be stored on CPU because it can not be opt
ndkgc/models/content_model.py:436
↓ 1 callersMethod_init_nontrainable_variables
Initialize all variables of the TF model. This should be called after the model is created, and no previous checkpoints are found. T
ndkgc/models/content_averaging_model.py:142
↓ 1 callersMethod_init_nontrainable_variables
Initialize all variables of the TF model. This should be called after the model is created, and no previous checkpoints are found. T
ndkgc/models/content_model.py:138
↓ 1 callersMethod_train_helper
(self, corrupt_head, ent, rel, true_targets, false_targets, device)
ndkgc/models/content_averaging_model.py:742
↓ 1 callersMethod_train_helper
(self, corrupt_head, ent, rel, true_targets, false_targets, device)
ndkgc/models/content_model.py:741
↓ 1 callersFunctioncorrupt_single_entity
Randomly corrupt head or tail with prob `head_corrupt_prob` :param triple: :param all_triples: :param max_entity_id: :param head_cor
ndkgc/ops/corruption.py:207
↓ 1 callersFunctioncorrupt_single_relationship
Corrupt the relationship by __sampling from [0, max_range] :param triple: :param all_triples: :param max_range: :param name: :re
ndkgc/ops/corruption.py:49
↓ 1 callersMethodcreate
(self, device='/cpu:0')
ndkgc/models/content_averaging_model.py:783
↓ 1 callersFunctioneval
()
ndkgc/models/dkrl.py:924
↓ 1 callersMethodeval
(self, eval_type, batch_size=100, precompute_split=10)
ndkgc/models/dkrl.py:560
↓ 1 callersFunctionextract_embedding_by_dkrl
Extract an embedding for each instance. This is similar to DKRL, the first k-1 layers are using maxpooling and the last layer uses mean pool
ndkgc/ops/content.py:263
↓ 1 callersFunctionextract_embedding_by_fcn
Extract an embedding for each instance. :param content_embedding: [batch_size, n_entities, content_len, word_embedding] :param conv_p
ndkgc/ops/content.py:386
↓ 1 callersFunctionhead_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/content_averaging_model.py:1378
↓ 1 callersFunctionhead_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/content_model.py:1383
↓ 1 callersMethodinitialize
(self, session)
ndkgc/models/content_averaging_model.py:799
↓ 1 callersFunctionload_list
(file_path)
tools/cleanup_fb15k_triples.py:9
↓ 1 callersFunctionload_pretrained_embedding
(pretrained_file_path, vocab, word_embedding_size, oov)
ndkgc/utils/__init__.py:80
↓ 1 callersMethodmanual_eval_head_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/content_averaging_model.py:1069
↓ 1 callersMethodmanual_eval_head_ops_v2
Manually evaluate one single partial triple with a given set of targets :param device: :return:
ndkgc/models/fcn_model_v2.py:349
↓ 1 callersMethodmanual_eval_head_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/content_model.py:1071
↓ 1 callersMethodmanual_eval_head_ops_v2
(self, device='/cpu:0')
ndkgc/models/cnn_model.py:236
↓ 1 callersMethodmanual_eval_tail_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/content_averaging_model.py:983
↓ 1 callersMethodmanual_eval_tail_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/fcn_model_v2.py:433
↓ 1 callersMethodmanual_eval_tail_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/content_model.py:985
↓ 1 callersMethodmanual_eval_tail_ops_v2
Manually evaluate one single partial triple with a given set of targets This function will reduce the computation by reusing the targets of
ndkgc/models/cnn_model.py:294
↓ 1 callersFunctiontail_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/content_averaging_model.py:1568
↓ 1 callersFunctiontail_eval_helper
(is_test=True, target_filter=True, eval_subset=set(), closed=False)
ndkgc/models/content_model.py:1573
↓ 1 callersFunctiontail_eval_helper_old
(is_test=True)
ndkgc/models/content_model.py:1782
next →1–100 of 158, ranked by callers