pytupli.dataset.BaseTupleParser

class BaseTupleParser[source]

Bases: object

Base class for parsing (nested) lists of obs/act/reward/term/trunc into tensors for other formats like numpy arrays, PyTorch tensors, etc. This class can be extended to implement specific parsing logic for different formats.

Methods

parse_lists

Parses the input lists into a format suitable for further processing.

classmethod parse_lists(obs: list[list[float]], act: list[list[float]], rew: list[float], term: list[bool], trunc: list[bool]) tuple[source]

Parses the input lists into a format suitable for further processing.

Parameters:
  • obs (list[list[float]]) – List of observations.

  • act (list[list[float]]) – List of actions.

  • rew (list[float]) – List of rewards.

  • term (list[bool]) – List of terminal flags.

  • trunc (list[bool]) – List of timeout flags.

Returns:

tuple – A tuple containing the parsed data in a suitable format.