code: def __init__(
      self,
      node_type,
      edge_type,
      node_max_id,
      edge_max_id,
      ent_dim,
      rel_dim,
      num_negs=5,
      margin=1,
      metric_name="mrr",
      corrupt="both",
      l2_regular=False,
      regular_param=0.0001,
      **kwargs,
  ):
      super(DistMult, self).__init__(**kwargs)
      self.node_type = node_type
      self.edge_type = edge_type
      self.node_max_id = node_max_id
      self.edge_max_id = edge_max_id
      self.ent_dim = ent_dim
      self.rel_dim = rel_dim
      self.num_negs = num_negs
      self.metric_name = metric_name
      self.corrupt = corrupt
      self.entity_encoder = tf_euler.utils.layers.Embedding(
          node_max_id + 1, ent_dim
      )
      self.relation_encoder = tf_euler.utils.layers.Embedding(
          edge_max_id + 1, rel_dim
      )
      self.margin = margin
      self.metric_class = tf_euler.utils.metrics.get(metric_name)
      self.l2_regular = l2_regular
      self.regular_param = regular_param
  
file_path: euler/examples/distmult/distmult.py
imports: import tensorflow
  import tf_euler
  import collections
label_desc: Use image node_id 1 to create a new DistMult object from inherited base classes: tf_euler.utils.layers with example: obj = DistMult(node_type, edge_type, node_max_id, edge_max_id, ent_dim, rel_dim, num_negs, margin, metric_name, corrupt, l2_regular, regular_param)