class_docstr: Given a sequence of even length, embed pairs of adjacent elements.
  Input is (batchsize, max_seqlength)
  seqlength should be even
  Output is (batchsize, 0.5*max_seqlength, emb_dim)
  
  This will embed all even and all odd elements of the sequence separately,
  concatenate the even embedding with the odd embeddings and then project the
  result to emb_dim.
  This is useful to project a sequence of [(rel, ent), ...] into a sequence
  of vectors for each (rel, ent) pair.
class_docstr_tok: ["Given","a","sequence","of","even","length",",","embed","pairs","of","adjacent","elements",".","Input","is","(","batchsize",",","max_seqlength",")","seqlength","should","be","even","Output","is","(","batchsize",",","0.5","*","max_seqlength",",","emb_dim",")","This","will","embed","all","even","and","all","odd","elements","of","the","sequence","separately",",","concatenate","the","even","embedding","with","the","odd","embeddings","and","then","project","the","result","to","emb_dim",".","This","is","useful","to","project","a","sequence","of","[","(","rel",",","ent",")",",","...","]","into","a","sequence","of","vectors","for","each","(","rel",",","ent",")","pair","."]
code: def __init__(
      self,
      emb_dim,
      is_train,
      train_dropout=1.0,
      input_dim_a=None,
      input_dim_b=None,
      embeddings_a=None,
      embeddings_b=None,
      scope="embed_pairs",
  ):
      super(EmbedAlternateSeq, self).__init__()
      self.emb_dim = emb_dim
      self.is_train = is_train
      self.dropout = train_dropout
      with tf.variable_scope(scope):
          if embeddings_a:
              self.embeddings_a = embeddings_a
          else:
              self.embeddings_a = tf.get_variable(
                  "embeddings_a",
                  shape=(input_dim_a, self.emb_dim),
                  initializer=tf.glorot_uniform_initializer(),
              )
          if embeddings_b:
              self.embeddings_b = embeddings_b
          else:
              self.embeddings_b = tf.get_variable(
                  "embeddings_b",
                  shape=(input_dim_b, self.emb_dim),
                  initializer=tf.glorot_uniform_initializer(),
              )
          self.proj_w = tf.get_variable(
              "W_embed_pair",
              shape=(2 * self.emb_dim, self.emb_dim),
              initializer=tf.glorot_uniform_initializer(),
          )
      if not embeddings_a:
          utils.add_variable_summaries(self.embeddings_a, scope)
      if not embeddings_b:
          utils.add_variable_summaries(self.embeddings_b, scope)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  import utils
label_desc: Use image node_id 1 to create a new EmbedAlternateSeq object from inherited base classes: Encoder with example: obj = EmbedAlternateSeq(emb_dim, is_train, train_dropout, input_dim_a, input_dim_b, embeddings_a, embeddings_b, scope)