Base class for processing individual trajectories.
convert_trajectory_with_env(trajectory: maze.core.trajectory_recording.records.trajectory_record.TrajectoryRecord, conversion_env: Optional[maze.core.env.maze_env.MazeEnv]) → List[maze.core.trajectory_recording.records.structured_spaces_record.StructuredSpacesRecord]¶
Convert an episode trajectory record into an array of observations and actions using the given env.
trajectory – Episode record to load
conversion_env – Env to use for conversion of MazeStates and MazeActions into observations and actions. Required only if state records are being loaded (i.e. conversion to raw actions and observations is needed).
Loaded observations and actions. I.e., a tuple (observation_list, action_list). Each of the lists contains observation/action dictionaries, with keys corresponding to IDs of structured sub-steps. (I.e., the dictionary will have just one entry for non-structured scenarios.)
pre_process(trajectory: maze.core.trajectory_recording.records.trajectory_record.TrajectoryRecord) → Union[maze.core.trajectory_recording.records.trajectory_record.TrajectoryRecord, List[maze.core.trajectory_recording.records.trajectory_record.TrajectoryRecord]]¶
Preprocess a given trajectory before passing it through the wrapper stack.
In order to deal with pre-processing methods that create multiple trajectories from a single one (e.g. data augmentation by permutation of subsets) a single trajectory can be returned as well as a list of multiple trajectories.
trajectory – The trajectory to preprocess.
The pre-processed trajectory or a list of multiple pre-processed trajectories.
process(trajectory: maze.core.trajectory_recording.records.trajectory_record.TrajectoryRecord, conversion_env: Optional[maze.core.env.maze_env.MazeEnv]) → List[List[maze.core.trajectory_recording.records.structured_spaces_record.StructuredSpacesRecord]]¶
Convert an individual trajectory, by calling the pre_processing method followed by the convert_trajectory_with_env
trajectory – Episode record to load.
A list (corresponding to the trajectories) of lists (corresponding to the steps of a individual trajectory) of Structured Spaces Records. Each Structures Spaces Record holds a single environment step with all corresponding information such as sub-step observations and actions as well as rewards and actor ids.