code: def evaluate_paths(paths, evaluator, unused_hparams, eval_logdir):
      """Evaluates negative loglikelihood of pianorolls from given paths."""
      for path in paths:
          name = "eval_samples_%s_%s_ensemble%s_chrono%s" % (
              lib_util.timestamp(),
              FLAGS.unit,
              FLAGS.ensemble_size,
              FLAGS.chronological,
          )
          log_fname = "%s__%s.npz" % (
              os.path.splitext(os.path.basename(path))[0],
              name,
          )
          log_fpath = os.path.join(eval_logdir, log_fname)
  
          pianorolls = get_path_pianorolls(path)
          rval = lib_evaluation.evaluate(evaluator, pianorolls)
          tf.logging.info(
              "Writing evaluation statistics to %s", log_fpath
          )
          with lib_util.atomic_file(log_fpath) as p:
              np.savez_compressed(p, **rval)
  
file_path: magenta/magenta/models/coconet/coconet_evaluate.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from magenta.models.coconet import lib_data
  from magenta.models.coconet import lib_evaluation
  from magenta.models.coconet import lib_graph
  from magenta.models.coconet import lib_util
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate_paths(paths, evaluator, unused_hparams, eval_logdir) without return types