code: def make_mlp_functional_model(hparams):
      """Creates a functional API-based multi-layer perceptron model."""
      inputs = tf.keras.Input(
          shape=(hparams.max_seq_length,), dtype="int64", name="words"
      )
  
      # Input is already one-hot encoded in the integer format. We cast it to
      # floating point format here.
      cur_layer = tf.keras.layers.Lambda(
          lambda x: tf.keras.backend.cast(x, tf.float32)
      )(inputs)
  
      for num_units in hparams.num_fc_units:
          cur_layer = tf.keras.layers.Dense(
              num_units, activation="relu"
          )(cur_layer)
          # For functional models, by default, Keras ensures that the 'dropout' layer
          # is invoked only during training.
          cur_layer = tf.keras.layers.Dropout(hparams.dropout_rate)(
              cur_layer
          )
  
      outputs = tf.keras.layers.Dense(
          hparams.num_classes, activation="softmax"
      )(cur_layer)
  
      model = tf.keras.Model(inputs, outputs=outputs)
      return model
  
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 5 for calling a global function with example usage: make_mlp_functional_model(hparams) and returns: model