Wrapper to encode a single relation into its EmQL representation.
(self, params, rel)
| 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.""" |
| 956 | set_ids = tf.expand_dims(rel, axis=1) |
| 957 | set_mask = tf.ones_like(set_ids, dtype=tf.float32) |
| 958 | return module.encode_op(params, set_ids, set_mask, |
| 959 | self.relation_embeddings_mat, |
| 960 | self.all_relation_sketches) |
| 961 | |
| 962 | def model_query2box(self, name, features, |
| 963 | params): |