(hparams, examples_path, output_dir)
Writes a tensorboard text summary of the trial.
Writes a tensorboard text summary of the trial.
Writes a tensorboard text summary of the trial .
def _trial_summary(hparams, examples_path, output_dir):
  """Writes a tensorboard text summary of the trial."""

  examples_path_summary = tf.summary.text(
      'examples_path', tf.constant(examples_path, name='examples_path'),
      collections=[])

  hparams_dict = hparams.values()

  # Create a markdown table from hparams.
  header = '| Key | Value |\n| :--- | :--- |\n'
  keys = sorted(hparams_dict.keys())
  lines = ['| %s | %s |' % (key, str(hparams_dict[key])) for key in keys]
  hparams_table = header + '\n'.join(lines) + '\n'

  hparam_summary = tf.summary.text(
      'hparams', tf.constant(hparams_table, name='hparams'), collections=[])

  with tf.Session() as sess:
    writer = tf.summary.FileWriter(output_dir, graph=sess.graph)
    writer.add_summary(examples_path_summary.eval())
    writer.add_summary(hparam_summary.eval())
    writer.close()
def _trial_summary ( hparams , examples_path , output_dir ) : examples_path_summary = tf . summary . text ( 'examples_path' , tf . constant ( examples_path , name = 'examples_path' ) , collections = [ ] ) hparams_dict = hparams . values ( ) # Create a markdown table from hparams. header = '| Key | Value |\n| :--- | :--- |\n' keys = sorted ( hparams_dict . keys ( ) ) lines = [ '| %s | %s |' % ( key , str ( hparams_dict [ key ] ) ) for key in keys ] hparams_table = header + '\n' . join ( lines ) + '\n' hparam_summary = tf . summary . text ( 'hparams' , tf . constant ( hparams_table , name = 'hparams' ) , collections = [ ] ) with tf . Session ( ) as sess : writer = tf . summary . FileWriter ( output_dir , graph = sess . graph ) writer . add_summary ( examples_path_summary . eval ( ) ) writer . add_summary ( hparam_summary . eval ( ) ) writer . close ( )