class_docstr: Base class for models
class_docstr_tok: ["Base","class","for","models"]
code: def _l2_loss(self):
      l2_loss = tf.zeros([1], dtype=tf.float32)
      # embedding_layer l2 loss
      for param in self.embed_params:
          l2_loss = tf.add(
              l2_loss,
              tf.multiply(self.hparams.embed_l2, tf.nn.l2_loss(param)),
          )
      params = self.layer_params
      for param in params:
          l2_loss = tf.add(
              l2_loss,
              tf.multiply(self.hparams.layer_l2, tf.nn.l2_loss(param)),
          )
      return l2_loss
  
imports: from os.path import join
  import abc
  import time
  import os
  import numpy
  import tensorflow
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 6 for calling the BaseModel obj's underlying member method code with example usage: obj._l2_loss() and returns: l2_loss