warp_drive.utils package
Submodules
warp_drive.utils.common module
- warp_drive.utils.common.check_env_header(header_file='env_config.h', path=None, num_envs=1, num_agents=1)
- warp_drive.utils.common.get_default_env_directory(env_name)
- warp_drive.utils.common.get_project_root() pathlib.Path
- warp_drive.utils.common.update_env_header(template_header_file, path=None, num_envs=1, num_agents=1)
- warp_drive.utils.common.update_env_runner(template_runner_file, path=None, env_name=None, customized_env_registrar: Optional[warp_drive.utils.env_registrar.EnvironmentRegistrar] = None)
warp_drive.utils.constants module
warp_drive.utils.data_feed module
- class warp_drive.utils.data_feed.DataFeed
Bases:
dict
Helper class to build up the data dict for CUDADataManager.push_data_to_device(data)
Example
data = DataFeed() data.add(name=”X”, data=[1,2,3], save_copy_and_apply_at_reset=True,
log_data_across_episode=True)
- add_data(name: str, data, save_copy_and_apply_at_reset: bool = False, log_data_across_episode: bool = False, **kwargs)
- Parameters
name – name of the data
data – data in the form of list, array or scalar
save_copy_and_apply_at_reset – the copy of the data will be saved inside GPU for the reset
log_data_across_episode – a data buffer of episode length is reserved for logging data
- add_data_list(data_list)
- Parameters
data_list – list of data configures either in dict or in tuple
for example add_data_list([(“x1”, x1, True),
(“x2”, x2, False, True), {“name”: “x3”,
“data”: x3, “save_copy_and_apply_at_reset”: False},
]
warp_drive.utils.recursive_obs_dict_to_spaces_dict module
- warp_drive.utils.recursive_obs_dict_to_spaces_dict.recursive_obs_dict_to_spaces_dict(obs)
Recursively return the observation space dictionary for a dictionary of observations
- Parameters
obs (dict) – A dictionary of observations keyed by agent index
environment (for a multi-agent) –
- Returns
A dictionary of observation spaces
- Return type
spaces.Dict