code: def run_fn(fn_args: tfx.components.FnArgs):
      """Train the model based on given args.
  
      Args:
        fn_args: Holds args used to train the model as name/value pairs.
      """
      tf_transform_output = tft.TFTransformOutput(
          fn_args.transform_output
      )
  
      train_dataset = input_fn(
          fn_args.train_files,
          fn_args.data_accessor,
          tf_transform_output,
          base.TRAIN_BATCH_SIZE,
      )
  
      eval_dataset = input_fn(
          fn_args.eval_files,
          fn_args.data_accessor,
          tf_transform_output,
          base.EVAL_BATCH_SIZE,
      )
  
      if fn_args.hyperparameters:
          hparams = kt.HyperParameters.from_config(
              fn_args.hyperparameters
          )
      else:
          # This is a shown case when hyperparameters is decided and Tuner is removed
          # from the pipeline. User can also inline the hyperparameters directly in
          # _make_keras_model.
          hparams = _get_hyperparameters()
  
      model = _make_keras_model(hparams)
      model.fit(train_dataset, validation_data=eval_dataset)
  
      print("Trained model:")
      model.summary()
  
      # Export the tensorboard logs.
      model.make_inspector().export_to_tensorboard(
          fn_args.model_run_dir
      )
  
      signatures = base.make_serving_signatures(
          model, tf_transform_output
      )
      model.save(
          fn_args.serving_model_dir,
          save_format="tf",
          signatures=signatures,
      )
  
file_path: tfx/tfx/examples/penguin/penguin_utils_tfdf_experimental.py
imports: from typing import List
  import keras_tuner
  import tensorflow
  import tensorflow_decision_forests
  import tensorflow_transform
  from tfx import v1
  from tfx.examples.penguin import penguin_utils_base
  from tfx_bsl.public import tfxio
label_desc: Use image node_id 5 for calling a global function with example usage: run_fn(fn_args) without return types