class_docstr: Compose embedding by attending to neighboring relations.
class_docstr_tok: ["Compose","embedding","by","attending","to","neighboring","relations","."]
docstr: Get neighbor attention probabilities given query.
docstr_tok: ["Get","neighbor","attention","probabilities","given","query","."]
code: def get_attention_probs(self, query, neighbors, nbr_mask, name=""):
      """Get neighbor attention probabilities given query."""
      query = tf.expand_dims(query, 1)
      nbr_scores = tf.squeeze(
          tf.matmul(query, neighbors, transpose_b=True), axis=1
      )
      # mask out non-existing neighbors by adding a large negative number
      nbr_scores += (1 - nbr_mask) * (-1e7)
      # attention_probs = tf.squeeze(tf.nn.softmax(nbr_scores, axis=-1), axis=-1)
      attention_probs = tf.nn.softmax(nbr_scores, axis=-1)
      self.add_to_collection("attention_probs", attention_probs)
      # add summary to monitor attention weights
      utils.add_histogram_summary(
          attention_probs, self.scope + "/" + name + "/attention_probs"
      )
      return attention_probs
  
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 for calling the RelAttentionEmbedding obj's underlying member method code with example usage: obj.get_attention_probs(query, neighbors, nbr_mask, name) and returns: attention_probs