code: def main(argv):
      # Check that the correct number of arguments have been provided. The
      # training and test data should contain 'tf.train.Example' objects in the
      # TFRecord format.
      if len(argv) != 3:
          raise app.UsageError(
              "Invalid number of arguments; expected 2, got %d"
              % (len(argv) - 1)
          )
  
      hparams = get_hyper_parameters()
      train_data_path = argv[1]
      test_data_path = argv[2]
  
      # Graph regularization configuration.
      graph_reg_config = nsl.configs.make_graph_reg_config(
          max_neighbors=hparams.num_neighbors,
          multiplier=hparams.graph_regularization_multiplier,
          distance_type=hparams.distance_type,
          sum_over_axis=-1,
      )
  
      # Create the base MLP models.
      base_models = {
          "FUNCTIONAL": make_mlp_functional_model(hparams),
          "SEQUENTIAL": make_mlp_sequential_model(hparams),
          "SUBCLASS": make_mlp_subclass_model(hparams),
      }
      for base_model_tag, base_model in base_models.items():
          logging.info(
              "\n====== %s BASE MODEL TEST BEGIN ======", base_model_tag
          )
          train_dataset = make_dataset(
              train_data_path, True, False, hparams
          )
          test_dataset = make_dataset(
              test_data_path, False, False, hparams
          )
          train_and_evaluate(
              base_model,
              "Base MLP model",
              train_dataset,
              test_dataset,
              hparams,
          )
  
          logging.info(
              "\n====== TRAINING WITH GRAPH REGULARIZATION ======\n"
          )
  
          # Wrap the base MLP model with graph regularization.
          graph_reg_model = nsl.keras.GraphRegularization(
              base_model, graph_reg_config
          )
          train_dataset = make_dataset(
              train_data_path, True, True, hparams
          )
          test_dataset = make_dataset(
              test_data_path, False, False, hparams
          )
          train_and_evaluate(
              graph_reg_model,
              "MLP + graph regularization",
              train_dataset,
              test_dataset,
              hparams,
          )
  
          logging.info(
              "\n====== %s BASE MODEL TEST END ======", base_model_tag
          )
  
file_path: neural-structured-learning/neural_structured_learning/examples/graph_keras_mlp_cora.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  from absl import logging
  import attr
  import neural_structured_learning
  import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: main(argv) without return types