tf_agents.trajectories.restart
Stay organized with collections
Save and categorize content based on your preferences.
Returns a TimeStep
with step_type
set equal to StepType.FIRST
.
tf_agents.trajectories.restart(
observation: tf_agents.typing.types.NestedTensorOrArray
,
batch_size: Optional[types.Int] = None,
reward_spec: Optional[types.NestedSpec] = None
) -> tf_agents.trajectories.TimeStep
Used in the notebooks
Args |
observation
|
A NumPy array, tensor, or a nested dict, list or tuple of
arrays or tensors.
|
batch_size
|
(Optional) A python or tensorflow integer scalar. If not
provided, the environment will not be considered as a batched environment.
|
reward_spec
|
If provided, the reward in the returned TimeStep will be
compatible with the provided reward_spec .
|
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.trajectories.restart\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/time_step.py#L135-L194) |\n\nReturns a `TimeStep` with `step_type` set equal to [`StepType.FIRST`](../../tf_agents/trajectories/StepType#FIRST).\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf_agents.trajectories.time_step.restart`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/restart)\n\n\u003cbr /\u003e\n\n tf_agents.trajectories.restart(\n observation: ../../tf_agents/typing/types/NestedTensorOrArray,\n batch_size: Optional[types.Int] = None,\n reward_spec: Optional[types.NestedSpec] = None\n ) -\u003e ../../tf_agents/trajectories/TimeStep\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - [Policies](https://www.tensorflow.org/agents/tutorials/3_policies_tutorial) - [Environments](https://www.tensorflow.org/agents/tutorials/2_environments_tutorial) - [Tutorial on Multi Armed Bandits in TF-Agents](https://www.tensorflow.org/agents/tutorials/bandits_tutorial) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `observation` | A NumPy array, tensor, or a nested dict, list or tuple of arrays or tensors. |\n| `batch_size` | (Optional) A python or tensorflow integer scalar. If not provided, the environment will not be considered as a batched environment. |\n| `reward_spec` | If provided, the reward in the returned `TimeStep` will be compatible with the provided `reward_spec`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `TimeStep`. ||\n\n\u003cbr /\u003e"]]