code: def make_mlp_subclass_model(hparams):
      """Creates a multi-layer perceptron subclass model in Keras."""
  
      class MLP(tf.keras.Model):
          """Subclass model defining a multi-layer perceptron."""
  
          def __init__(self):
              super(MLP, self).__init__()
              self.cast_to_float_layer = tf.keras.layers.Lambda(
                  lambda x: tf.keras.backend.cast(x, tf.float32)
              )
              self.dense_layers = [
                  tf.keras.layers.Dense(num_units, activation="relu")
                  for num_units in hparams.num_fc_units
              ]
              self.dropout_layer = tf.keras.layers.Dropout(
                  hparams.dropout_rate
              )
              self.output_layer = tf.keras.layers.Dense(
                  hparams.num_classes, activation="softmax"
              )
  
          def call(self, inputs, training=False):
              cur_layer = self.cast_to_float_layer(inputs["words"])
              for dense_layer in self.dense_layers:
                  cur_layer = dense_layer(cur_layer)
                  cur_layer = self.dropout_layer(
                      cur_layer, training=training
                  )
  
              outputs = self.output_layer(cur_layer)
  
              return outputs
  
      return MLP()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import threading
  from absl import app
  from absl import flags
  from absl import logging
  import attr
  import neural_structured_learning
  from research.carls import dynamic_embedding_config_pb2
  from research.carls import dynamic_embedding_neighbor_cache
  from research.carls import graph_regularization
  from research.carls import kbs_server_helper_pybind
  import tensorflow
  from google.protobuf import text_format
label_desc: Use image node_id 6 for calling a global function with example usage: make_mlp_subclass_model(hparams) and returns: MLP, outputs