imitation.data.serialize#

Serialization utilities for trajectories.

Functions

load(path)

Loads a sequence of trajectories saved by save() from path.

load_with_rewards(path)

Loads a sequence of trajectories with rewards from a file.

save(path, trajectories)

Save a sequence of Trajectories to disk using HuggingFace's datasets library.

imitation.data.serialize.load(path)[source]#

Loads a sequence of trajectories saved by save() from path.

Return type

Sequence[Trajectory]

imitation.data.serialize.load_with_rewards(path)[source]#

Loads a sequence of trajectories with rewards from a file.

Return type

Sequence[TrajectoryWithRew]

imitation.data.serialize.save(path, trajectories)[source]#

Save a sequence of Trajectories to disk using HuggingFace’s datasets library.

Parameters
  • path (Union[str, bytes, PathLike]) – Trajectories are saved to this path.

  • trajectories (Sequence[Trajectory]) – The trajectories to save.

Return type

None