class_docstr: Orthogonal Relation Transforms with Graph Context Modeling for Knowledge Graph Embedding.
  https://aclanthology.org/2020.acl-main.241/
class_docstr_tok: ["Orthogonal","Relation","Transforms","with","Graph","Context","Modeling","for","Knowledge","Graph","Embedding",".","https",":","\/\/aclanthology.org\/2020.acl-main.241\/"]
docstr: Orthogonalize embeddings.
          
docstr_tok: ["Orthogonalize","embeddings","."]
code: def gram_schimidt_process(self, embeds, eps=1e-18, do_test=True):
      """Orthogonalize embeddings."""
      assert embeds.shape[1] == self.num_elem
      assert embeds.shape[2] == (self.num_elem + int(self.use_scale))
      if self.use_scale:
          scales = embeds[:, :, -1]
          embeds = embeds[:, :, : self.num_elem]
  
      u = [embeds[:, 0]]
      uu = [0] * self.num_elem
      uu[0] = (u[0] * u[0]).sum(axis=-1)
      u_d = embeds[:, 1:]
      for i in range(1, self.num_elem):
          tmp = (embeds[:, i:] * u[i - 1].unsqueeze(axis=1)).sum(
              axis=-1
          )
          tmp = (tmp / uu[i - 1].unsqueeze(axis=1)).unsqueeze(axis=-1)
          u_d = u_d - u[-1].unsqueeze(axis=1) * tmp
          u_i = u_d[:, 0]
          if u_d.shape[1] > 1:
              u_d = u_d[:, 1:]
          uu[i] = (u_i * u_i).sum(axis=-1)
          u.append(u_i)
  
      u = paddle.stack(u, axis=1)
      u = u / u.norm(axis=-1, keepdim=True, p=2)
      if self.use_scale:
          u = paddle.concat([u, scales.unsqueeze(-1)], axis=-1)
      return u
  
imports: import math
  import numpy
  from numpy.random import RandomState
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.functional import log_sigmoid
label_desc: Use image node_id 10 for calling the OTEScore obj's underlying member method code with example usage: obj.gram_schimidt_process(embeds, eps, do_test) and returns: u