|View source on GitHub|
Observer for writing episodes to Reverb.
tf_agents.typing.types.ReverbClient, table_name: Union[Text, Sequence[Text]], max_sequence_length: int, priority: Union[float, int] = 1, bypass_partial_episodes: bool = False )
Used in the notebooks
|Used in the tutorials|
This observer should be called at every step. It does not support batched trajectories. The steps are cached and written at the end of the episode.
At the end of each episode, an item is written to Reverb. Each item is the
trajectory containing an episode, including a boundary step in the end.
Therefore, the sequence lengths of the items may vary. If you want a fixed
sequence length, use
Unfinished episodes remain in the cache and do not get written until
reset(write_cached_steps=True) is called.
consumer, if your episodes have variable lengths.
||Python client for the reverb replay server.|
||The table name(s) where samples will be written to.|
||Initial priority for the table.|
||If max_sequence_length is not positive.|
close() -> None
Closes the writer of the observer.
Ensures that items are pushed to the service.
open() -> None
Open the writer of the observer. This is a no-op if it's already open.
reset( write_cached_steps: bool = True ) -> None
Resets the state of the observer.
By default, if there is remaining data in the cache,
write them to Reverb before clearing the cache. If
update_priority( priority: Union[float, int] ) -> None
Update the table priority.
||Updates the priority of the observer.|
ValueError: If priority is not numeric.
tf_agents.trajectories.Trajectory) -> None
Cache the single step trajectory to be written into Reverb.
Allows trajectory to be a flattened trajectory. No batch dimension allowed.
||The trajectory to be written which could be (possibly nested) trajectory object or a flattened version of a trajectory. It assumes there is no batch dimension.|