tf_agents.eval.metric_utils.eager_compute
Stay organized with collections
Save and categorize content based on your preferences.
Compute metrics using policy
on the environment
.
tf_agents . eval . metric_utils . eager_compute (
metrics ,
environment ,
policy ,
num_episodes = 1 ,
train_step = None ,
summary_writer = None ,
summary_prefix = '' ,
use_function = True
)
Note: Because placeholders are not compatible with Eager mode we can not use
python policies. Because we use tf_policies we need the environment time_steps
to be tensors making it easier to use a tf_env for evaluations. Otherwise this
method mirrors compute
directly.
Args
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.
Returns
A dictionary of results {metric_name: metric_value}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]