class_docstr: Defines a generalized additive model (GAM) layer.
  
  This layer implements the neural generalized additive ranking model described
  in [Zhuang et al, 2021][zhuang2021].
  
  Neural Generalized Additive Ranking Model is an additive ranking model.
  For each example `x` with `n` features `(x_1, x_2, ..., x_n)`, the ranking
  score is:
  
    $$F(x) = f_1(x_1) + f_2(x_2) + \ldots + f_n(x_n)$$
  
  where each feature is scored by a corresponding submodel, and the overall
  ranking score is the sum of all the submodels' outputs. Each submodel is a
  standalone feed-forward network.
  
  When there are `m` context features `(c_1, c_2, ..., c_m)`, the ranking score
  will be determined by:
  
    $$F(c, x) = w_1(c) * f_1(x_1) + w_2(c) * f_2(x_2) + \ldots + w_n(c) *
    f_n(x_n)$$
  
  where `(w1(c), w2(c), ..., wn(c))` is a weighting vector determined solely by
  context features. For each context feature `c_j`, a feed-forward submodel is
  constructed to derive a weighting vector
  `(wj1(c_j), wj2(c_j), ..., wjn(c_j))`. The final weighting vector is the sum
  of the output of all the context features' submodels.
  
  The model is implicitly interpretable as the contribution of each feature to
  the final ranking score can be easily visualized. However, the model does not
  have higher-order inter-feature interactions and hence may not have
  performance as good as a fully-connected DNN.
  
  The output of each example feature's submodel can be retrieved by tensor
  named `{feature_name}_subscore`. The output of each context feature's submodel
  is a n-dimensional vector and can be retrieved by tensor named
  `{feature_name}_subweight`.
  
  ```python
  example_inputs = tf.constant([[1], [0], [-1]], dtype=tf.float32)
  context_inputs = tf.constant([[1, 2], [0, 1], [-1, 1]], dtype=tf.float32)
  gam = layers.GAMLayer(2, [3, 2, 1], 2, [3, 2, 1])
  outputs, sublogits_list, subweights_list = gam(
      ([example_inputs, example_inputs], [context_inputs, context_inputs]))
  ```
  
  References:
    - [Interpretable Ranking with Generalized Additive Models, Zhuang et al,
       2021][zhuang2021]
  
  [zhuang2021]: https://research.google/pubs/pub50040/
code: def get_config(self):
      config = super().get_config()
      config.update(
          {
              "example_feature_num": self._example_feature_num,
              "context_feature_num": self._context_feature_num,
              "example_hidden_layer_dims": self._example_hidden_layer_dims,
              "context_hidden_layer_dims": self._context_hidden_layer_dims,
              "activation": tf.keras.activations.serialize(
                  self._activation
              ),
              "use_batch_norm": self._use_batch_norm,
              "batch_norm_moment": self._batch_norm_moment,
              "dropout": self._dropout,
          }
      )
      return config
  
imports: import math
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import tensorflow
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 3 for calling the GAMLayer obj's underlying member method code with example usage: obj.get_config() and returns: config