d3rlpy.dataset.BasicTrajectorySlicer

class d3rlpy.dataset.BasicTrajectorySlicer(*args, **kwargs)[source]

Standard trajectory slicer.

This class implements a basic trajectory slicing.

Methods

__call__(episode, end_index, size)[source]

Slice trajectory.

This method returns a partial trajectory from t=end_index-size to t=end_index. If end_index-size is smaller than 0, those parts will be padded by zeros.

Parameters:
  • episode (EpisodeBase) – Episode.

  • end_index (int) – Index at the end of the sliced trajectory.

  • size (int) – Length of the sliced trajectory.

Returns:

Sliced trajectory.

Return type:

PartialTrajectory