deepvariant/model_eval.py
def _write_checkpoint_metrics(checkpoint_path,
                              metrics_and_values,
                              eval_name,
                              current_metrics='current.metrics'):
  """Writes a JSON of metrics for checkpoint_path in eval_name.

  This function writes out metrics to a JSON for a checkpoint into
  .../eval_name.
  The exact path of this file will be computed with:

    `checkpoint_metrics_path(checkpoint_path, eval_name)`

  and the values for metrics_and_values (a dict of strings => objects) written
  out as key: str(object) into a JSON file.

  Args:
    checkpoint_path: str; a path to the checkpoint we computed metrics on.
    metrics_and_values: dict[string,object]; a dictionary of key/value pairs
      containing our metrics. These will be converted to a JSON of key/string
      pairs and written out to disk.
    eval_name: str; the name of the eval run, which is used to derive the the
      subdirectory of checkpoint_path where the eval metrics will be written.
    current_metrics: str; a single file that contains most recent metrics
      values, and gets updated at each checkpoint.
  """
  path = checkpoint_metrics_path(checkpoint_path, eval_name)
  experiment_metrics_path = checkpoint_metrics_path(
      checkpoint_path, eval_name, file_name=current_metrics)
  serializable = {k: str(v) for k, v in metrics_and_values.items()}
  logging.info('Writing checkpoint metrics %s', path)
  try:
    with tf.io.gfile.GFile(path, 'w') as fout:
      json.dump(serializable, fout, sort_keys=True, indent=4)
    with tf.io.gfile.GFile(experiment_metrics_path, 'w') as eout:
      json.dump(serializable, eout, sort_keys=True, indent=4)
  except:  # pylint: disable=bare-except
    # Note we have a bare exception here as as there's no clear TF base
    # exception to catch will cover all of the potential issues that might arise
    # trying to write our metrics to our metrics file.
    logging.warning('Failed to write checkpoint metrics to path %s', path)
Writes a JSON of metrics for checkpoint_path in eval_name.

  This function writes out metrics to a JSON for a checkpoint into
  .../eval_name.
  The exact path of this file will be computed with:

    `checkpoint_metrics_path(checkpoint_path, eval_name)`

  and the values for metrics_and_values (a dict of strings => objects) written
  out as key: str(object) into a JSON file.

  Args:
    checkpoint_path: str; a path to the checkpoint we computed metrics on.
    metrics_and_values: dict[string,object]; a dictionary of key/value pairs
      containing our metrics. These will be converted to a JSON of key/string
      pairs and written out to disk.
    eval_name: str; the name of the eval run, which is used to derive the the
      subdirectory of checkpoint_path where the eval metrics will be written.
    current_metrics: str; a single file that contains most recent metrics
      values, and gets updated at each checkpoint.
  
Writes a JSON of metrics for checkpoint_path in eval_name.
This function writes out metrics to a JSON for a checkpoint into
/eval_name.
The exact path of this file will be computed with.



and the values for metrics_and_values (a dict of strings => objects) written
out as key: str(object) into a JSON file.
Writes a JSON of metrics for checkpoint_path in eval_name . This function writes out metrics to a JSON for a checkpoint into / eval_name . The exact path of this file will be computed with . and the values for metrics_and_values ( a dict of strings = > objects ) written out as key : str ( object ) into a JSON file .
def _write_checkpoint_metrics(checkpoint_path,
                              metrics_and_values,
                              eval_name,
                              current_metrics='current.metrics'):
  path = checkpoint_metrics_path(checkpoint_path, eval_name)
  experiment_metrics_path = checkpoint_metrics_path(
      checkpoint_path, eval_name, file_name=current_metrics)
  serializable = {k: str(v) for k, v in metrics_and_values.items()}
  logging.info('Writing checkpoint metrics %s', path)
  try:
    with tf.io.gfile.GFile(path, 'w') as fout:
      json.dump(serializable, fout, sort_keys=True, indent=4)
    with tf.io.gfile.GFile(experiment_metrics_path, 'w') as eout:
      json.dump(serializable, eout, sort_keys=True, indent=4)
  except:  
    logging.warning('Failed to write checkpoint metrics to path %s', path)
def _write_checkpoint_metrics ( checkpoint_path , metrics_and_values , eval_name , current_metrics = 'current.metrics' ) : path = checkpoint_metrics_path ( checkpoint_path , eval_name ) experiment_metrics_path = checkpoint_metrics_path ( checkpoint_path , eval_name , file_name = current_metrics ) serializable = { k : str ( v ) for k , v in metrics_and_values . items ( ) } logging . info ( 'Writing checkpoint metrics %s' , path ) try : with tf . io . gfile . GFile ( path , 'w' ) as fout : json . dump ( serializable , fout , sort_keys = True , indent = 4 ) with tf . io . gfile . GFile ( experiment_metrics_path , 'w' ) as eout : json . dump ( serializable , eout , sort_keys = True , indent = 4 ) except : logging . warning ( 'Failed to write checkpoint metrics to path %s' , path )
Writes a JSON of metrics for checkpoint_path in eval_name.
Writes a JSON of metrics for checkpoint_path in eval_name .
"""Writes a JSON of metrics for checkpoint_path in eval_name.

  This function writes out metrics to a JSON for a checkpoint into
  .../eval_name.
  The exact path of this file will be computed with:

    `checkpoint_metrics_path(checkpoint_path, eval_name)`

  and the values for metrics_and_values (a dict of strings => objects) written
  out as key: str(object) into a JSON file.

  Args:
    checkpoint_path: str; a path to the checkpoint we computed metrics on.
    metrics_and_values: dict[string,object]; a dictionary of key/value pairs
      containing our metrics. These will be converted to a JSON of key/string
      pairs and written out to disk.
    eval_name: str; the name of the eval run, which is used to derive the the
      subdirectory of checkpoint_path where the eval metrics will be written.
    current_metrics: str; a single file that contains most recent metrics
      values, and gets updated at each checkpoint.
  """ # pylint: disable=bare-except # Note we have a bare exception here as as there's no clear TF base # exception to catch will cover all of the potential issues that might arise # trying to write our metrics to our metrics file.
checkpoint_path
str; a path to the checkpoint we computed metrics on.
str ; a path to the checkpoint we computed metrics on .
metrics_and_values
dict[string,object]; a dictionary of key/value pairs
containing our metrics. These will be converted to a JSON of key/string
pairs and written out to disk.
dict [ string object ] ; a dictionary of key / value pairs containing our metrics . These will be converted to a JSON of key / string pairs and written out to disk .
eval_name
str; the name of the eval run, which is used to derive the the
subdirectory of checkpoint_path where the eval metrics will be written.
str ; the name of the eval run which is used to derive the the subdirectory of checkpoint_path where the eval metrics will be written .
current_metrics
str; a single file that contains most recent metrics
values, and gets updated at each checkpoint.
str ; a single file that contains most recent metrics values and gets updated at each checkpoint .