DiscretizeActionsWrapper

class maze.core.wrappers.discretize_actions_wrapper.DiscretizeActionsWrapper(*args, **kwds)
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: gym.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 ActionWrapper interface.

property action_space

(overrides StructuredEnvSpacesMixin)

The currently active gym action space.

property action_spaces_dict

(overrides StructuredEnvSpacesMixin)

A dictionary of gym action spaces, with policy IDs as keys.

clone_from(env: maze.core.wrappers.discretize_actions_wrapper.DiscretizeActionsWrapper)None

(overrides SimulatedEnvMixin)

implementation of SimulatedEnvMixin.

reverse_action(action: Dict[str, numpy.ndarray]) → Dict[str, numpy.ndarray]

(overrides ActionWrapper)

Implementation of ActionWrapper interface.