code: def projection(self, embedding, matrix):
      output_shape = embedding.shape
      embedding = tf.reshape(embedding, [-1, 1, self.ent_dim])
      matrix = tf.reshape(matrix, [-1, self.ent_dim, self.rel_dim])
      embedding = tf.reshape(
          tf.matmul(embedding, matrix), [-1, self.rel_dim]
      )
      embedding = tf.nn.l2_normalize(embedding, 1)
      output_shape = [
          d if d is not None else -1
          for d in output_shape.as_list()[:-1]
      ]
      output_shape = output_shape + [self.rel_dim]
      embedding = tf.reshape(embedding, output_shape)
      return embedding
  
file_path: euler/examples/TransX/transR.py
imports: from transX import TransX
  import tensorflow
  import tf_euler
  import numpy
label_desc: Use image node_id 2 for calling the TransR obj's underlying member method code with example usage: obj.projection(embedding, matrix) and returns: embedding