code: def build_model(kbs_address: typing.Text):
      """Constructs a ConvNet-based model configured from flags using keras API."""
  
      dm_config = build_dm_config_from_flags()
      mode = tf.constant(dm_ops.LOOKUP_WITH_UPDATE, dtype=tf.int32)
  
      # Builds normalization layer.
      if FLAGS.use_batch_normalization:
          normalization_layer = tf.keras.layers.BatchNormalization(
              axis=1, center=True, scale=True, momentum=0
          )
      else:
          normalization_layer = dn.DynamicNormalization(
              dm_config,
              mode=mode,
              axis=1,
              epsilon=0.001,
              service_address=kbs_address,
          )
  
      # Number of target classes
      if FLAGS.dataset in ["mnist", "cifar10"]:
          num_classes = 10
      else:
          num_classes = 100
  
      # Builds a simple image model with a normalization layer at the top.
      model = tf.keras.models.Sequential(
          [
              tf.keras.layers.Conv2D(32, (3, 3), activation="relu"),
              tf.keras.layers.MaxPooling2D((2, 2)),
              tf.keras.layers.Conv2D(64, (3, 3), activation="relu"),
              tf.keras.layers.MaxPooling2D((2, 2)),
              tf.keras.layers.Flatten(),
              tf.keras.layers.Dense(
                  FLAGS.hidden_size, activation="relu"
              ),
              normalization_layer,
              tf.keras.layers.Dense(num_classes, activation="softmax"),
          ]
      )
      model.compile(
          loss="sparse_categorical_crossentropy",
          optimizer=tf.keras.optimizers.Adam(FLAGS.learning_rate),
          metrics=["accuracy"],
      )
  
      return model
  
file_path: neural-structured-learning/research/carls/examples/dynamic_normalization/image_dataset_eval_main.py
imports: import typing
  from absl import app
  from absl import flags
  from research.carls import dynamic_embedding_config_pb2
  from research.carls import dynamic_memory_ops
  from research.carls import dynamic_normalization
  from research.carls import kbs_server_helper_pybind
  import tensorflow
  import tensorflow_datasets
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling a global function with example usage: build_model(kbs_address) and returns: model