tf_agents.metrics.tf_metrics.ChosenActionHistogram
Stay organized with collections
Save and categorize content based on your preferences.
Metric to compute the frequency of each action chosen.
Inherits From: TFHistogramStepMetric
, TFStepMetric
tf_agents.metrics.tf_metrics.ChosenActionHistogram(
name='ChosenActionHistogram', dtype=tf.int32, buffer_size=100
)
Methods
call
View source
call(
trajectory
)
init_variables
View source
init_variables()
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
reset()
result
View source
result()
tf_summaries
View source
tf_summaries(
train_step=None, step_metrics=()
)
Generates histogram summaries against train_step and all 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 histogram summaries.
|
__call__
View source
__call__(
*args, **kwargs
)
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() .
|
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.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf_agents.metrics.tf_metrics.ChosenActionHistogram\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metrics.py#L368-L390) |\n\nMetric to compute the frequency of each action chosen.\n\nInherits From: [`TFHistogramStepMetric`](../../../tf_agents/metrics/tf_metric/TFHistogramStepMetric), [`TFStepMetric`](../../../tf_agents/metrics/tf_metric/TFStepMetric) \n\n tf_agents.metrics.tf_metrics.ChosenActionHistogram(\n name='ChosenActionHistogram', dtype=tf.int32, buffer_size=100\n )\n\nMethods\n-------\n\n### `call`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metrics.py#L379-L382) \n\n call(\n trajectory\n )\n\n### `init_variables`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metric.py#L61-L75) \n\n init_variables()\n\nInitializes this Metric's variables.\n\nShould be called after variables are created in the first execution\nof `__call__()`. If using graph execution, the return value should be\n`run()` in a session before running the op returned by `__call__()`.\n(See example above.)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| 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. ||\n\n\u003cbr /\u003e\n\n### `reset`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metrics.py#L388-L390) \n\n reset()\n\n### `result`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metrics.py#L384-L386) \n\n result()\n\n### `tf_summaries`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metric.py#L136-L168) \n\n tf_summaries(\n train_step=None, step_metrics=()\n )\n\nGenerates histogram summaries against train_step and all step_metrics.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------------|-----------------------------------------------------------------------------------------------------------|\n| `train_step` | (Optional) Step counter for training iterations. If None, no metric is generated against the global step. |\n| `step_metrics` | (Optional) Iterable of step metrics to generate summaries against. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A list of histogram summaries. ||\n\n\u003cbr /\u003e\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/tf_metric.py#L82-L92) \n\n __call__(\n *args, **kwargs\n )\n\nReturns op to execute to update this metric for these inputs.\n\nReturns None if eager execution is enabled.\nReturns a graph-mode function if graph execution is enabled.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|------------|--------------------------------------------------------------|\n| `*args` | \u003cbr /\u003e \u003cbr /\u003e |\n| `**kwargs` | A mini-batch of inputs to the Metric, passed on to `call()`. |\n\n\u003cbr /\u003e"]]