docstr: m_spa: the dimensionality of sparse feature embeddings
  ln_emb: the size of sparse feature embeddings (num_instances)
  ln_bot: the size of the bottom MLP
  ln_top: the size of the top MLP
docstr_tok: ["m_spa",":","the","dimensionality","of","sparse","feature","embeddings","ln_emb",":","the","size","of","sparse","feature","embeddings","(","num_instances",")","ln_bot",":","the","size","of","the","bottom","MLP","ln_top",":","the","size","of","the","top","MLP"]
code: def __init__(
      self,
      m_spa,
      ln_emb,
      ln_bot,
      ln_top,
      arch_interaction_op="dot",
      arch_interaction_itself=False,
      sigmoid_bot=False,
      sigmoid_top=True,
      loss_func="mse",
      loss_threshold=0.0,
  ):
      """
      m_spa: the dimensionality of sparse feature embeddings
      ln_emb: the size of sparse feature embeddings (num_instances)
      ln_bot: the size of the bottom MLP
      ln_top: the size of the top MLP
      """
  
      super(DLRM, self).__init__()
  
      self._loss_threshold = loss_threshold
      self._loss_func = loss_func
      self._latent_factors = [
          LatentFactor(num_instances=num, dim=m_spa) for num in ln_emb
      ]
      self._mlp_bot = MLP(
          units_list=ln_bot,
          out_activation="sigmoid" if sigmoid_bot else "relu",
      )
      self._mlp_top = MLP(
          units_list=ln_top,
          out_activation="sigmoid" if sigmoid_top else "relu",
      )
  
      self._dot_interaction = None
      if arch_interaction_op == "dot":
          self._dot_interaction = SecondOrderFeatureInteraction(
              self_interaction=arch_interaction_itself
          )
  
      elif self._arch_interaction_op != "cat":
          sys.exit(
              "ERROR: arch_interaction_op="
              + self._arch_interaction_op
              + " is not supported"
          )
  
      if loss_func == "mse":
          self._loss = tf.keras.losses.MeanSquaredError()
      elif loss_func == "bce":
          self._loss = tf.keras.losses.BinaryCrossentropy()
      else:
          sys.exit(
              "ERROR: loss_func=" + loss_func + " is not supported"
          )
  
file_path: openrec/openrec/tf2/recommenders/dlrm.py
imports: import sys
  import tensorflow
  from tensorflow.keras import Model
  from openrec.tf2.modules import LatentFactor, SecondOrderFeatureInteraction, MLP
label_desc: Use image node_id 1 to create a new DLRM object from inherited base classes: Model with example: obj = DLRM(m_spa, ln_emb, ln_bot, ln_top, arch_interaction_op, arch_interaction_itsigmoid_bot, sigmoid_top, loss_func, loss_threshold)