class maze.core.trajectory_recording.records.trajectory_record.SpacesTrajectoryRecord(*args, **kwds)

Holds structured spaces records (i.e., raw actions and observations recorded during a rollout).

property actions

Convenience access to all structured action dicts from this trajectory.


Convenience method for checking whether the end of this trajectory represents also the end of an episode.

property observations

Convenience access to all structured observation dicts from this trajectory.

property rewards

Convenience access to all structured reward dicts from this trajectory.


Stack the whole trajectory into a single structured spaces record.

Useful for processing whole fixed-length trajectories in a single batch.

classmethod stack_trajectories(trajectories: List[SpacesTrajectoryRecord])maze.core.trajectory_recording.records.trajectory_record.SpacesTrajectoryRecord

Stack multiple trajectories, keeping the time dimension intact.

All the trajectories should be of the same length. The resulting trajectory will have the same number of steps, each being a stack of the corresponding steps of the input trajectories.


trajectories – Trajectories to stack.


Trajectory record of the same lenght, consisting of stacked structured spaces records.


Convenience method for calculating the total reward of a given trajectory.