class_docstr: SLI Rec model
  
  :Citation:
  
      Z. Yu, J. Lian, A. Mahmoody, G. Liu and X. Xie, "Adaptive User Modeling with
      Long and Short-Term Preferences for Personailzed Recommendation", in Proceedings of
      the 28th International Joint Conferences on Artificial Intelligence, IJCAI’19,
      Pages 4213-4219, AAAI Press, 2019.
docstr: The main function to create sli_rec model.
  
  Returns:
      object: the output of sli_rec section.
docstr_tok: ["The","main","function","to","create","sli_rec","model",".","Returns",":","object",":","the","output","of","sli_rec","section","."]
code: def _build_seq_graph(self):
      """The main function to create sli_rec model.
  
      Returns:
          object: the output of sli_rec section.
      """
      hparams = self.hparams
      with tf.compat.v1.variable_scope("sli_rec"):
          hist_input = tf.concat(
              [
                  self.item_history_embedding,
                  self.cate_history_embedding,
              ],
              2,
          )
          self.mask = self.iterator.mask
          self.sequence_length = tf.reduce_sum(
              input_tensor=self.mask, axis=1
          )
  
          with tf.compat.v1.variable_scope("long_term_asvd"):
              att_outputs1 = self._attention(
                  hist_input, hparams.attention_size
              )
              att_fea1 = tf.reduce_sum(
                  input_tensor=att_outputs1, axis=1
              )
              tf.compat.v1.summary.histogram("att_fea1", att_fea1)
  
          item_history_embedding_new = tf.concat(
              [
                  self.item_history_embedding,
                  tf.expand_dims(
                      self.iterator.time_from_first_action, -1
                  ),
              ],
              -1,
          )
          item_history_embedding_new = tf.concat(
              [
                  item_history_embedding_new,
                  tf.expand_dims(self.iterator.time_to_now, -1),
              ],
              -1,
          )
          with tf.compat.v1.variable_scope("rnn"):
              rnn_outputs, _ = dynamic_rnn(
                  Time4LSTMCell(hparams.hidden_size),
                  inputs=item_history_embedding_new,
                  sequence_length=self.sequence_length,
                  dtype=tf.float32,
                  scope="time4lstm",
              )
              tf.compat.v1.summary.histogram(
                  "LSTM_outputs", rnn_outputs
              )
  
          with tf.compat.v1.variable_scope("attention_fcn"):
              att_outputs2 = self._attention_fcn(
                  self.target_item_embedding, rnn_outputs
              )
              att_fea2 = tf.reduce_sum(
                  input_tensor=att_outputs2, axis=1
              )
              tf.compat.v1.summary.histogram("att_fea2", att_fea2)
  
          # ensemble
          with tf.compat.v1.name_scope("alpha"):
              concat_all = tf.concat(
                  [
                      self.target_item_embedding,
                      att_fea1,
                      att_fea2,
                      tf.expand_dims(
                          self.iterator.time_to_now[:, -1], -1
                      ),
                  ],
                  1,
              )
              last_hidden_nn_layer = concat_all
              alpha_logit = self._fcn_net(
                  last_hidden_nn_layer,
                  hparams.att_fcn_layer_sizes,
                  scope="fcn_alpha",
              )
              alpha_output = tf.sigmoid(alpha_logit)
              user_embed = att_fea1 * alpha_output + att_fea2 * (
                  1.0 - alpha_output
              )
          model_output = tf.concat(
              [user_embed, self.target_item_embedding], 1
          )
          tf.compat.v1.summary.histogram("model_output", model_output)
          return model_output
  
file_path: recommenders/recommenders/models/deeprec/models/sequential/sli_rec.py
imports: import tensorflow
  from recommenders.models.deeprec.models.sequential.sequential_base_model import SequentialBaseModel
  from tensorflow.compat.v1.nn import dynamic_rnn
  from recommenders.models.deeprec.models.sequential.rnn_cell_implement import Time4LSTMCell
label_desc: Use image node_id 1 for calling the SLI_RECModel obj's underlying member method code with example usage: obj._build_seq_graph() and returns: model_output