tf_agents.eval.metric_utils.eager_compute

Compute metrics using policy on the environment.

metrics List of metrics to compute.
environment tf_environment instance.
policy tf_policy instance used to step the environment.
num_episodes Number of episodes to compute the metrics over.
train_step An optional step to write summaries against.
summary_writer An optional writer for generating metric summaries.
summary_prefix An optional prefix scope for metric summaries.
use_function Option to enable use of tf.function when collecting the metrics.

A dictionary of results {metric_name: metric_value}