code: def train(
      master,
      tpu_cluster,
      model_fn,
      data_fn,
      additional_trial_info,
      model_dir,
      preprocess_examples,
      hparams,
      keep_checkpoint_max,
      use_tpu,
      num_steps=None,
      warm_start_from=None,
  ):
      """Train loop."""
      estimator = create_estimator(
          model_fn=model_fn,
          model_dir=model_dir,
          master=master,
          tpu_cluster=tpu_cluster,
          hparams=hparams,
          keep_checkpoint_max=keep_checkpoint_max,
          use_tpu=use_tpu,
          warm_start_from=warm_start_from,
      )
  
      if estimator.config.is_chief:
          _trial_summary(
              hparams=hparams,
              model_dir=model_dir,
              output_dir=model_dir,
              additional_trial_info=additional_trial_info,
          )
  
      transcription_data = functools.partial(
          data_fn,
          preprocess_examples=preprocess_examples,
          is_training=True,
          shuffle_examples=True,
          skip_n_initial_records=0,
      )
  
      estimator.train(input_fn=transcription_data, max_steps=num_steps)
  
file_path: magenta/magenta/models/onsets_frames_transcription/train_util.py
imports: import collections
  import copy
  import functools
  import random
  import sys
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tf_slim
label_desc: Use image node_id 3 for calling a global function with example usage: train(master, tpu_cluster, model_fn, data_fn, additional_trial_info, model_dir, preprocess_examples, hparams, keep_checkpoint_max, use_tpu, num_steps, warm_start_from) without return types