DiscretizeActionsWrapper¶
- class maze.core.wrappers.discretize_actions_wrapper.DiscretizeActionsWrapper(env: StructuredEnvSpacesMixin | StructuredEnv, discretization_config: Dict[str, Dict[str, int | float | List[int | float]]])¶
- The DiscretizeActionsWrapper provides functionality for discretizing individual continuous actions into discrete
ones.
An example is given by having a continuous action called ‘action_up’ with space: gymnasium.spaces.Box(shape=(5,), low=[-1,-1,-1,-1,-1], high=[1,1,1,1,1]
- discretization_config:
- action_up:
num_bins: 5 low: [-1, 0, 0.5, 0, 0] high: 1
Now the action space will be split where each of the 5 continuous values of the box spaces are split evenly within the ranges of (-1,1),(0,1),(0.5,1), (0,1), (0,1) respectively.
- Parameters:
env – Environment/wrapper to wrap.
discretization_config – The action discretization configuration.
- action(action: Dict[str, numpy.ndarray]) Dict[str, numpy.ndarray]¶
(overrides
ActionWrapper)Implementation of
ActionWrapperinterface.
- property action_space: gymnasium.spaces.Dict¶
(overrides
StructuredEnvSpacesMixin)The currently active gym action space.
- property action_spaces_dict: Dict[int | str, gymnasium.spaces.Dict]¶
(overrides
StructuredEnvSpacesMixin)A dictionary of gym action spaces, with policy IDs as keys.
- clone_from(env: DiscretizeActionsWrapper) None¶
(overrides
SimulatedEnvMixin)implementation of
SimulatedEnvMixin.
- reverse_action(action: Dict[str, numpy.ndarray]) Dict[str, numpy.ndarray]¶
(overrides
ActionWrapper)Implementation of
ActionWrapperinterface.