code: def build_base_model(hparams):
      """Builds a model according to the architecture defined in `hparams`."""
      inputs = tf.keras.Input(
          shape=hparams.input_shape,
          dtype=tf.float32,
          name=FEATURE_INPUT_NAME,
      )
  
      x = inputs
      for filter_idx, num_filters in enumerate(hparams.conv_filters):
          x = tf.keras.layers.Conv2D(
              num_filters, hparams.kernel_size, activation="relu"
          )(x)
          if filter_idx < len(hparams.conv_filters) - 1:
              # max pooling between convolutional layers
              x = tf.keras.layers.MaxPooling2D(hparams.pool_size)(x)
      x = tf.keras.layers.Flatten()(x)
      for num_hidden_units in hparams.dense_units:
          x = tf.keras.layers.Dense(
              num_hidden_units, activation="relu"
          )(x)
      pred = tf.keras.layers.Dense(
          hparams.num_classes, activation="softmax"
      )(x)
      model = tf.keras.Model(inputs=inputs, outputs=pred)
      return model
  
file_path: neural-structured-learning/neural_structured_learning/examples/adv_keras_cnn_mnist.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  import attr
  import neural_structured_learning
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: build_base_model(hparams) and returns: model