Transition¶
-
class
Transition
(s0: torch.Tensor, a: torch.Tensor = None, r: torch.Tensor = None, s1: torch.Tensor = None, done: bool = False, x0: torch.Tensor = None, x1: torch.Tensor = None, a1: torch.Tensor = None, a_dist: torch.distributions.distribution.Distribution = None, o: Option = None, ρ: float = 1.0, buffer_index: int = - 1, info: dict = {})¶ Bases:
tuple
An experience tuple.
The main purpose of the class is to hold \((s,a,r,s')\) tuples. Additional info required by some algorithms can also be added.
- TODO: consider using dataclasses from python3.7
- pros:
mutability
- cons:
potentially larger memory footprint incompatible with python3.6 need to write a custom __iter__ method