class_docstr: Global Attention Pooling from `Gated Graph Sequence Neural Networks
  <https://arxiv.org/abs/1511.05493.pdf>`__
  
  .. math::
      r^{(i)} = \sum_{k=1}^{N_i}\mathrm{softmax}\left(f_{gate}
      \left(x^{(i)}_k\right)\right) f_{feat}\left(x^{(i)}_k\right)
  
  Parameters
  ----------
  gate_nn : tf.layers.Layer
      A neural network that computes attention scores for each feature.
  feat_nn : tf.layers.Layer, optional
      A neural network applied to each feature before combining them
      with attention scores.
class_docstr_tok: ["Global","Attention","Pooling","from","`","Gated","Graph","Sequence","Neural","Networks","<","https",":","\/\/arxiv.org\/abs\/1511.05493.pdf",">","`","__","..","math",":",":","r^","{","(","i",")","}","=","\\sum_","{","k=1","}","^","{","N_i","}","\\mathrm","{","softmax","}","\\left","(","f_","{","gate","}","\\left","(","x^","{","(","i",")","}","_k\\right",")","\\right",")","f_","{","feat","}","\\left","(","x^","{","(","i",")","}","_k\\right",")","Parameters","--","--","--","--","--","gate_nn",":","tf.layers.Layer","A","neural","network","that","computes","attention","scores","for","each","feature",".","feat_nn",":","tf.layers.Layer",",","optional","A","neural","network","applied","to","each","feature","before","combining","them","with","attention","scores","."]
code: def __init__(self, gate_nn, feat_nn=None):
      super(GlobalAttentionPooling, self).__init__()
      self.gate_nn = gate_nn
      self.feat_nn = feat_nn
  
imports: import tensorflow
  from tensorflow.keras import layers
  from ...readout import max_nodes, mean_nodes, softmax_nodes, sum_nodes, topk_nodes
label_desc: Use image node_id 1 to create a new GlobalAttentionPooling object from inherited base classes: layers with example: obj = GlobalAttentionPooling(gate_nn, feat_nn)