mani_skill.utils.gym_utils ========================== .. py:module:: mani_skill.utils.gym_utils .. autoapi-nested-parse:: various gymnasium/gym utilities used in ManiSkill, mostly to handle observation/action spaces and noramlization Attributes ---------- .. autoapisummary:: mani_skill.utils.gym_utils.IS_GYMNASIUM_1 mani_skill.utils.gym_utils.IS_GYMNASIUM_1 Functions --------- .. autoapisummary:: mani_skill.utils.gym_utils.clip_and_scale_action mani_skill.utils.gym_utils.convert_observation_to_space mani_skill.utils.gym_utils.extract_scalars_from_info mani_skill.utils.gym_utils.find_max_episode_steps_value mani_skill.utils.gym_utils.get_dtype_bounds mani_skill.utils.gym_utils.inv_clip_and_scale_action mani_skill.utils.gym_utils.inv_scale_action mani_skill.utils.gym_utils.normalize_action_space Module Contents --------------- .. py:function:: clip_and_scale_action(action, low, high) Clip action to [-1, 1] and scale according to a range [low, high]. .. py:function:: convert_observation_to_space(observation, prefix='', unbatched=False) Convert observation to OpenAI gym observation space (recursively). Modified from `gym.envs.mujoco_env` .. py:function:: extract_scalars_from_info(info, blacklist=(), batch_size=1) Recursively extract scalar metrics from an info dict returned by env.step. :param info: info dict :type info: dict :param blacklist: keys to exclude. :type blacklist: tuple, optional :returns: scalar metrics :rtype: dict[str, float] .. py:function:: find_max_episode_steps_value(env) Finds the max episode steps parameter given by user or registered in the environment. This is a useful utility as not all specs may include max episode steps and some wrappers may need access to this in order to implement e.g. TimeLimits correctly on the GPU sim. .. py:function:: get_dtype_bounds(dtype) Gets the min and max values of a given numpy type .. py:function:: inv_clip_and_scale_action(action, low, high) Inverse of `clip_and_scale_action`. .. py:function:: inv_scale_action(action, low, high) Inverse of `clip_and_scale_action` without clipping. .. py:function:: normalize_action_space(action_space) .. py:data:: IS_GYMNASIUM_1 :value: False .. py:data:: IS_GYMNASIUM_1 :value: True