(fold, evaluator, hparams, eval_logdir, checkpoint_dir)
Writes to file the neg. loglikelihood of given fold (train/valid/test).
Writes to file the neg. loglikelihood of given fold (train/valid/test).
Writes to file the neg . loglikelihood of given fold ( train / valid / test ) .
def evaluate_fold(fold, evaluator, hparams, eval_logdir, checkpoint_dir):
  """Writes to file the neg. loglikelihood of given fold (train/valid/test)."""
  eval_run_name = 'eval_%s_%s%s_%s_ensemble%s_chrono%s' % (
      lib_util.timestamp(), fold,
      '' if FLAGS.fold_index is None else FLAGS.fold_index, FLAGS.unit,
      FLAGS.ensemble_size, FLAGS.chronological)
  log_fname = '%s__%s.npz' % (os.path.basename(checkpoint_dir), eval_run_name)
  log_fpath = os.path.join(eval_logdir, log_fname)

  pianorolls = get_fold_pianorolls(fold, hparams)

  rval = lib_evaluation.evaluate(evaluator, pianorolls)
  tf.logging.info('Writing to path: %s' % log_fpath)
  with lib_util.atomic_file(log_fpath) as p:
    np.savez_compressed(p, **rval)
def evaluate_fold ( fold , evaluator , hparams , eval_logdir , checkpoint_dir ) : eval_run_name = 'eval_%s_%s%s_%s_ensemble%s_chrono%s' % ( lib_util . timestamp ( ) , fold , '' if FLAGS . fold_index is None else FLAGS . fold_index , FLAGS . unit , FLAGS . ensemble_size , FLAGS . chronological ) log_fname = '%s__%s.npz' % ( os . path . basename ( checkpoint_dir ) , eval_run_name ) log_fpath = os . path . join ( eval_logdir , log_fname ) pianorolls = get_fold_pianorolls ( fold , hparams ) rval = lib_evaluation . evaluate ( evaluator , pianorolls ) tf . logging . info ( 'Writing to path: %s' % log_fpath ) with lib_util . atomic_file ( log_fpath ) as p : np . savez_compressed ( p , * * rval )