class_docstr: Max Pooling Aggregator for GraphSAGE implemented with Keras base layer
  
  Implements the aggregator of Eq. (3) in Hamilton et al. (2017)
  
  Args:
      output_dim (int): Output dimension
      bias (bool): Optional bias
      act (Callable or str): name of the activation function to use (must be a
          Keras activation function), or alternatively, a TensorFlow operation.
class_docstr_tok: ["Max","Pooling","Aggregator","for","GraphSAGE","implemented","with","Keras","base","layer","Implements","the","aggregator","of","Eq",".","(","3",")","in","Hamilton","et","al",".","(","2017",")","Args",":","output_dim","(","int",")",":","Output","dimension","bias","(","bool",")",":","Optional","bias","act","(","Callable","or","str",")",":","name","of","the","activation","function","to","use","(","must","be","a","Keras","activation","function",")",",","or","alternatively",",","a","TensorFlow","operation","."]
docstr: Builds the weight tensor(s) corresponding to the features of the input groups.
  
  Args:
      in_shape (list of int): Shape of input tensor for single group
      out_size (int): The size of the output vector for this group
      group_idx (int): The index of the input group
docstr_tok: ["Builds","the","weight","tensor","(","s",")","corresponding","to","the","features","of","the","input","groups",".","Args",":","in_shape","(","list","of","int",")",":","Shape","of","input","tensor","for","single","group","out_size","(","int",")",":","The","size","of","the","output","vector","for","this","group","group_idx","(","int",")",":","The","index","of","the","input","group"]
code: def _build_group_weights(self, in_shape, out_size, group_idx=0):
      """
      Builds the weight tensor(s) corresponding to the features of the input groups.
  
      Args:
          in_shape (list of int): Shape of input tensor for single group
          out_size (int): The size of the output vector for this group
          group_idx (int): The index of the input group
  
      """
      if group_idx == 0:
          weights = self.add_weight(
              name=f"w_g{group_idx}",
              shape=(int(in_shape[-1]), out_size),
              initializer=self.kernel_initializer,
              regularizer=self.kernel_regularizer,
              constraint=self.kernel_constraint,
              trainable=True,
          )
      else:
          w_group = self.add_weight(
              name=f"w_g{group_idx}",
              shape=(self.hidden_dim, out_size),
              initializer=self.kernel_initializer,
              regularizer=self.kernel_regularizer,
              constraint=self.kernel_constraint,
              trainable=True,
          )
          w_pool = self.add_weight(
              name=f"w_pool_g{group_idx}",
              shape=(int(in_shape[-1]), self.hidden_dim),
              initializer=self.kernel_initializer,
              regularizer=self.kernel_regularizer,
              constraint=self.kernel_constraint,
              trainable=True,
          )
          b_pool = self.add_weight(
              name=f"b_pool_g{group_idx}",
              shape=(self.hidden_dim,),
              initializer=self.bias_initializer,
              regularizer=self.bias_regularizer,
              constraint=self.bias_constraint,
              trainable=True,
          )
          weights = [w_group, w_pool, b_pool]
      return weights
  
imports: import warnings
  import numpy
  from tensorflow.keras.layers import Layer
  from tensorflow.keras import Input
  from tensorflow.keras import backend
  from tensorflow.keras.layers import Lambda, Dropout, Reshape, LeakyReLU
  from tensorflow.keras.utils import Sequence
  from tensorflow.keras import activations, initializers, constraints, regularizers
  from typing import List, Tuple, Callable, AnyStr, Union
  from ..mapper import GraphSAGENodeGenerator, GraphSAGELinkGenerator, DirectedGraphSAGENodeGenerator, DirectedGraphSAGELinkGenerator, NodeSequence, LinkSequence
  from .misc import deprecated_model_function
  from ..connector.neo4j.mapper import Neo4jGraphSAGENodeGenerator, Neo4jDirectedGraphSAGENodeGenerator
label_desc: Use image node_id 2 for calling the MaxPoolingAggregator obj's underlying member method code with example usage: obj._build_group_weights(in_shape, out_size, group_idx) and returns: weights