code: def main(argv):
      del argv
      graph_reg_config = nsl.configs.GraphRegConfig(
          neighbor_config=nsl.configs.GraphNeighborConfig(
              max_neighbors=3
          ),
          multiplier=0.1,
          distance_config=nsl.configs.DistanceConfig(
              distance_type=nsl.configs.DistanceType.L2,
              reduction=tf.compat.v1.losses.Reduction.NONE,
              sum_over_axis=-1,
          ),
      )
  
      train_dataset = gnn.make_cora_dataset(
          FLAGS.train_examples_path,
          shuffle=True,
          neighbor_config=graph_reg_config.neighbor_config,
      )
      eval_dataset = gnn.make_cora_dataset(
          FLAGS.eval_examples_path, batch_size=32
      )
  
      model = gnn.GraphRegularizationModel(
          config=graph_reg_config,
          node_model_fn=functools.partial(
              NodeClassifier,
              seq_length=tf.data.experimental.get_structure(
                  train_dataset
              )[0]["words"].shape[-1],
              num_classes=7,
          ),
      )
      model.compile(
          optimizer=tf.keras.optimizers.Adam(),
          loss=tf.keras.losses.SparseCategoricalCrossentropy(
              from_logits=True
          ),
          metrics=[
              tf.keras.metrics.SparseCategoricalCrossentropy(
                  from_logits=True
              ),
              tf.keras.metrics.SparseCategoricalAccuracy(),
              tf.keras.metrics.SparseTopKCategoricalAccuracy(2),
          ],
      )
      model.fit(train_dataset, epochs=30, validation_data=eval_dataset)
  
file_path: neural-structured-learning/neural_structured_learning/examples/graph_nets_cora_graph_regularization.py
imports: import functools
  from absl import app
  from absl import flags
  import graph_nets
  import neural_structured_learning
  from neural_structured_learning.experimental import gnn
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: main(argv) without return types