code: def __init__(self, ent_tot, rel_tot, dim=100):
      super(Analogy, self).__init__(ent_tot, rel_tot)
  
      self.dim = dim
      self.ent_re_embeddings = nn.Embedding(self.ent_tot, self.dim)
      self.ent_im_embeddings = nn.Embedding(self.ent_tot, self.dim)
      self.rel_re_embeddings = nn.Embedding(self.rel_tot, self.dim)
      self.rel_im_embeddings = nn.Embedding(self.rel_tot, self.dim)
      self.ent_embeddings = nn.Embedding(self.ent_tot, self.dim * 2)
      self.rel_embeddings = nn.Embedding(self.rel_tot, self.dim * 2)
  
      nn.init.xavier_uniform_(self.ent_re_embeddings.weight.data)
      nn.init.xavier_uniform_(self.ent_im_embeddings.weight.data)
      nn.init.xavier_uniform_(self.rel_re_embeddings.weight.data)
      nn.init.xavier_uniform_(self.rel_im_embeddings.weight.data)
      nn.init.xavier_uniform_(self.ent_embeddings.weight.data)
      nn.init.xavier_uniform_(self.rel_embeddings.weight.data)
  
file_path: OpenKE/openke/module/model/Analogy.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from .Model import Model
label_desc: Use image node_id 1 to create a new Analogy object from inherited base classes: Model with example: obj = Analogy(ent_tot, rel_tot, dim)