d2c.data¶
BaseData¶
-
class
BaseData(data_path: Union[str, List[str]])[source]¶ Bases:
abc.ABCThe basic class of the replay buffer. Inherit this class to build data loaders for practical application and benchmark experiments.
The API methods the user should implement are:
_build_data(): Construct the data through adding the transitions into the replay buffer._build_data_loader(): Construct the data loader.
- Parameters
data_path (str) – the file path of the dataset.
-
property
data¶ Return the replay buffer.
Data¶
-
class
Data(config)[source]¶ Bases:
d2c.data.data.BaseDataCreate the replay buffer with batch data that is from the benchmarks or real-world applications dataset.
It uses different data loaders to get the transitions and adds them into the replay buffer. This class generates the dataset for the offline RL training.
The main methods that users of this class need to know are:
data(): Return the constructed replay buffer;_build_data_loader(): Read the batch data and create a data loader. It builds different data loader according to the corresponding parameters in the configuration._build_data(): Create a replay buffer and add the data into it.
Note
To add a data loader for a new benchmark, you should implement a new method _xxx_data_loader`(like :meth:`_app_data_loader,
_d4rl_data_loader()) and add this method into_data_loader_list().- Parameters
config – the configuration.
-
property
state_shift_scale¶