class_docstr: Compose embedding by attending to neighbors using simple dot product.
  Concatenates and projects (node, query_rel) to an embedding that is used to
  attend to the neighbor embeddings.
class_docstr_tok: ["Compose","embedding","by","attending","to","neighbors","using","simple","dot","product",".","Concatenates","and","projects","(","node",",","query_rel",")","to","an","embedding","that","is","used","to","attend","to","the","neighbor","embeddings","."]
code: def __init__(
      self,
      input_dim,
      is_train,
      train_dropout=1.0,
      emb_dim=None,
      proj_e=None,
      proj_w=None,
      scope="attention",
  ):
      super(CosineNbrAttentionEmbedding, self).__init__()
      self.input_dim = input_dim
      self.scope = scope
      self.is_train = is_train
      self.dropout = train_dropout
      if emb_dim:
          self.emb_dim = emb_dim
      else:
          # Keep embedding dimension same as input node embedding
          self.emb_dim = self.input_dim
      with tf.variable_scope(scope):
          if proj_e:
              self.proj_e = proj_e
          else:
              self.proj_e = tf.get_variable(
                  "W_embed",
                  shape=(2 * self.input_dim, self.emb_dim),
                  initializer=tf.glorot_uniform_initializer(),
              )
          if proj_w:
              self.proj_w = proj_w
          else:
              self.proj_w = tf.get_variable(
                  "W_attention",
                  shape=(2 * self.input_dim, self.emb_dim),
                  initializer=tf.glorot_uniform_initializer(),
              )
      if not proj_w:
          utils.add_variable_summaries(
              self.proj_w, self.scope + "/W_attention"
          )
  
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 CosineNbrAttentionEmbedding object from inherited base classes: Encoder with example: obj = CosineNbrAttentionEmbedding(input_dim, is_train, train_dropout, emb_dim, proj_e, proj_w, scope)