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: To make the document embedding be dense, we add one tanh layer on top of the `kims_cnn` module.
code: def _build_doc_embedding(
      self, candidate_word_batch, candidate_entity_batch
  ):
      """
      To make the document embedding be dense, we add one tanh layer on top of the `kims_cnn` module.
      """
      with tf.compat.v1.variable_scope(
          "kcnn", initializer=self.initializer
      ):
          news_field_embed = self._kims_cnn(
              candidate_word_batch, candidate_entity_batch, self.hparams
          )
          W = tf.compat.v1.get_variable(
              name="W_doc_trans",
              shape=(
                  news_field_embed.shape[-1],
                  self.num_filters_total,
              ),
              dtype=tf.float32,
              initializer=tf.compat.v1.keras.initializers.VarianceScaling(
                  scale=1.0,
                  mode="fan_avg",
                  distribution=(
                      "uniform" if False else "truncated_normal"
                  ),
              ),
          )
          if W not in self.layer_params:
              self.layer_params.append(W)
          news_field_embed = tf.tanh(tf.matmul(news_field_embed, W))
      return news_field_embed
  
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 4 for calling the DKNItem2Item obj's underlying member method code with example usage: obj._build_doc_embedding(candidate_word_batch, candidate_entity_batch) and returns: news_field_embed