pantheonrl.common.trajsaver.TransitionsMinimal
- class TransitionsMinimal(obs, acts)[source]
Bases:
DatasetThis class is modified from HumanCompatibleAI’s imitation repo: https://github.com/HumanCompatibleAI/imitation/blob/master/src/imitation/ data/types.py
A Torch-compatible Dataset of obs-act transitions. This class and its subclasses are usually instantiated via imitation.data.rollout.flatten_trajectories. Indexing an instance trans of TransitionsMinimal with an integer i returns the i`th `Dict[str, np.ndarray] sample, whose keys are the field names of each dataclass field and whose values are the ith elements of each field value. Slicing returns a possibly empty instance of TransitionsMinimal where each field has been sliced.
Methods
Construct TransitionsMinimal from file
Write transition to a given file.
Attributes
Previous observations.
Actions.
- Parameters:
obs (ndarray) –
acts (ndarray) –
- acts: ndarray
Actions. Shape: (batch_size,) + action_shape.
- obs: ndarray
Previous observations. Shape: (batch_size, ) + observation_shape. The i’th observation obs[i] in this array is the observation seen by the agent when choosing action acts[i]. obs[i] is not required to be from the timestep preceding obs[i+1].