d3rlpy.dataset.FrameStackTrajectorySlicer¶
- class d3rlpy.dataset.FrameStackTrajectorySlicer(n_frames)[source]¶
Frame-stacking trajectory slicer.
This class implements the frame-stacking logic. The observations are stacked with the last
n_frames-1
frames. Whenindex
specifies timestep belown_frames
, those frames are padded by zeros.episode = Episode( observations=np.random.random((100, 1, 84, 84)), actions=np.random.random((100, 2)), rewards=np.random.random((100, 1)), terminated=False, ) frame_stacking_slicer = FrameStackTrajectorySlicer(n_frames=4) trajectory = frame_stacking_slicer(episode, 0, 10) trajectory.observations.shape == (10, 4, 84, 84)
- Parameters:
n_frames – Number of frames to stack.
Methods