tf_agents.metrics.py_metrics.NumpyDeque
Stay organized with collections
Save and categorize content based on your preferences.
Deque implementation using a numpy array as a circular buffer.
Inherits From: NumpyState
tf_agents.metrics.py_metrics.NumpyDeque(
maxlen: tf_agents.typing.types.Int
,
dtype: np.dtype
)
Args |
maxlen
|
Maximum length of the deque before beginning to evict the oldest
entries. If np.inf, deque size is unlimited and the array will grow
automatically.
|
dtype
|
Data type of deque elements.
|
Methods
add
View source
add(
value: Any
)
clear
View source
clear()
extend
View source
extend(
values: Iterable[Any]
)
mean
View source
mean(
dtype: Optional[np.dtype] = None
)
__len__
View source
__len__() -> tf_agents.typing.types.Int
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.py_metrics.NumpyDeque\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L34-L90) |\n\nDeque implementation using a numpy array as a circular buffer.\n\nInherits From: [`NumpyState`](../../../tf_agents/utils/numpy_storage/NumpyState) \n\n tf_agents.metrics.py_metrics.NumpyDeque(\n maxlen: ../../../tf_agents/typing/types/Int,\n dtype: np.dtype\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxlen` | Maximum length of the deque before beginning to evict the oldest entries. If np.inf, deque size is unlimited and the array will grow automatically. |\n| `dtype` | Data type of deque elements. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|--------|---------------|\n| `last` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `add`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L56-L68) \n\n add(\n value: Any\n )\n\n### `clear`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L52-L54) \n\n clear()\n\n### `extend`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L70-L72) \n\n extend(\n values: Iterable[Any]\n )\n\n### `mean`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L85-L90) \n\n mean(\n dtype: Optional[np.dtype] = None\n )\n\n### `__len__`\n\n[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/metrics/py_metrics.py#L82-L83) \n\n __len__() -\u003e ../../../tf_agents/typing/types/Int"]]