class_docstr: Class for item-to-item recommendations using DKN.
  See https://github.com/microsoft/recommenders/blob/main/examples/07_tutorials/KDD2020-tutorial/step4_run_dkn_item2item.ipynb
docstr: The main function to create DKN's logic.
  
  Returns:
      object: Prediction of item2item relation scores made by the DKN model, in the shape of (`batch_size`, `num_negative` + 1).
code: def _build_dkn(self):
      """The main function to create DKN's logic.
  
      Returns:
          object: Prediction of item2item relation scores made by the DKN model, in the shape of (`batch_size`, `num_negative` + 1).
      """
      news_field_embed_final_batch = self._build_doc_embedding(
          self.iterator.candidate_news_index_batch,
          self.iterator.candidate_news_entity_index_batch,
      )
  
      self.news_field_embed_final_batch = tf.math.l2_normalize(
          news_field_embed_final_batch, axis=-1, epsilon=1e-12
      )
  
      item_embs_train = tf.reshape(
          self.news_field_embed_final_batch,
          [
              -1,
              self.iterator.neg_num + 2,
              self.news_field_embed_final_batch.shape[-1],
          ],
      )  # (B, group, D)
  
      item_embs_source = item_embs_train[:, 0, :]  # get the source item
      item_embs_source = tf.expand_dims(item_embs_source, 1)
  
      item_embs_target = item_embs_train[:, 1:, :]
  
      item_relation = tf.math.multiply(
          item_embs_target, item_embs_source
      )
      item_relation = tf.reduce_sum(
          input_tensor=item_relation, axis=-1
      )  # (B, neg_num + 1)
  
      self.pred_logits = item_relation
  
      return self.pred_logits
  
file_path: recommenders/recommenders/models/deeprec/models/dkn_item2item.py
imports: import numpy
  import tensorflow
  from recommenders.models.deeprec.models.dkn import DKN
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 2 for calling the DKNItem2Item obj's underlying member method code with example usage: obj._build_dkn() and returns: self