class_docstr: DKN model (Deep Knowledge-Aware Network)
  
  :Citation:
  
      H. Wang, F. Zhang, X. Xie and M. Guo, "DKN: Deep Knowledge-Aware Network for News
      Recommendation", in Proceedings of the 2018 World Wide Web Conference on World
      Wide Web, 2018.
class_docstr_tok: ["DKN","model","(","Deep","Knowledge-Aware","Network",")",":","Citation",":","H.","Wang",",","F.","Zhang",",","X.","Xie","and","M.","Guo",",","``","DKN",":","Deep","Knowledge-Aware","Network","for","News","Recommendation","''",",","in","Proceedings","of","the","2018","World","Wide","Web","Conference","on","World","Wide","Web",",","2018","."]
code: def _l2_loss(self):
      hparams = self.hparams
      l2_loss = tf.zeros([1], dtype=tf.float32)
      # embedding_layer l2 loss
      l2_loss = tf.add(
          l2_loss,
          tf.multiply(hparams.embed_l2, tf.nn.l2_loss(self.embedding)),
      )
      if hparams.use_entity:
          l2_loss = tf.add(
              l2_loss,
              tf.multiply(
                  hparams.embed_l2, tf.nn.l2_loss(self.entity_embedding)
              ),
          )
      if hparams.use_entity and hparams.use_context:
          l2_loss = tf.add(
              l2_loss,
              tf.multiply(
                  hparams.embed_l2,
                  tf.nn.l2_loss(self.context_embedding),
              ),
          )
      params = self.layer_params
      for param in params:
          l2_loss = tf.add(
              l2_loss,
              tf.multiply(hparams.layer_l2, tf.nn.l2_loss(param)),
          )
      return l2_loss
  
file_path: recommenders/recommenders/models/deeprec/models/dkn.py
imports: import numpy
  import tensorflow
  from recommenders.models.deeprec.models.base_model import BaseModel
label_desc: Use image node_id 3 for calling the DKN obj's underlying member method code with example usage: obj._l2_loss() and returns: l2_loss