Skip to content

ReplayBatch ​

python
ReplayBatch(states: list[np.ndarray], actions: list[int], rewards: list[float], next_states: list[np.ndarray], dones: list[bool], n_steps: list[int], reward_shaping_metadata: dict[str, list[int | float]] | None = None) -> None

Owned replay columns ready to be inserted into the replay buffer.

Source

Properties ​

batch_size ​

python
batch_size: int

Get the number of transitions in the batch.

Returns:

  • int – The number of transitions.

Source

Methods ​

from_buffered_transitions ​

python
from_buffered_transitions(transitions: list[BufferedTransition]) -> ReplayBatch

Build a replay batch from buffered transition tuples.

Parameters:

  • transitions (list[BufferedTransition]) – Buffered transitions to convert.

Returns:

  • ReplayBatch – A replay batch containing the transition columns.

Source

merge ​

python
merge(batches: list[ReplayBatch]) -> ReplayBatch

Merge several replay batches into one larger batch.

Parameters:

  • batches (list[ReplayBatch]) – Replay batches to combine in order.

Returns:

  • ReplayBatch – A single merged replay batch.

Source

Values ​

actions ​

python
actions: list[int]

Source

dones ​

python
dones: list[bool]

Source

n_steps ​

python
n_steps: list[int]

Source

next_states ​

python
next_states: list[np.ndarray]

Source

reward_shaping_metadata ​

python
reward_shaping_metadata: dict[str, list[int | float]] | None = None

Source

rewards ​

python
rewards: list[float]

Source

states ​

python
states: list[np.ndarray]

Source