ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tf_agents.metrics.tf_metric.TFMultiMetricStepMetric

A TF step metric that emits multiple values per step.

Inherits From: TFStepMetric

The only difference between TFSTepMetric and TFMultiMetricStepMetric is that the latter creates at each step many scalar summaries, one per metric.

metric_names

Methods

call

View source

Accumulates statistics for the metric. Users should use call instead.

Args
*args

**kwargs A mini-batch of inputs to the Metric, as passed to __call__().

init_variables

View source

Initializes this Metric's variables.

Should be called after variables are created in the first execution of __call__(). If using graph execution, the return value should be run() in a session before running the op returned by __call__(). (See example above.)

Returns
If using graph execution, this returns an op to perform the initialization. Under eager execution, the variables are reset to their initial values as a side effect and this function returns None.

reset

View source

Resets the values being tracked by the metric.

result

View source

Computes and returns a final value for the metric.

tf_summaries

View source

Generates per-metric summaries against train_step and step_metrics.

Args
train_step (Optional) Step counter for training iterations. If None, no metric is generated against the global step.
step_metrics (Optional) Iterable of step metrics to generate summaries against.

Returns
A list of scalar summaries.

__call__

View source

Returns op to execute to update this metric for these inputs.

Returns None if eager execution is enabled. Returns a graph-mode function if graph execution is enabled.

Args
*args

**kwargs A mini-batch of inputs to the Metric, passed on to call().