(paths, evaluator, unused_hparams, eval_logdir)
Evaluates negative loglikelihood of pianorolls from given paths.
Evaluates negative loglikelihood of pianorolls from given paths.
Evaluates negative loglikelihood of pianorolls from given paths .
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)
def evaluate_paths ( paths , evaluator , unused_hparams , eval_logdir ) : 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 )