Wrapper to encode a single entity into its EmQL representation.
(self, params, ent)
| 944 | return object_embs, object_sketch |
| 945 | |
| 946 | def simple_entity_encode_op(self, params, ent): |
| 947 | """Wrapper to encode a single entity into its EmQL representation.""" |
| 948 | set_ids = tf.expand_dims(ent, axis=1) |
| 949 | set_mask = tf.ones_like(set_ids, dtype=tf.float32) |
| 950 | return module.encode_op(params, set_ids, set_mask, |
| 951 | self.entity_embeddings_mat, |
| 952 | self.all_entity_sketches) |
| 953 | |
| 954 | def simple_relation_encode_op(self, params, rel): |
| 955 | """Wrapper to encode a single relation into its EmQL representation.""" |