Environment Wrappers¶
This page contains the reference documentation for environment wrappers. Here you can find a more extensive write up on how to work with these.
Overview
Interfaces and Utilities¶
These are the wrapper interfaces, base classes and interfaces:
A transparent environment Wrapper that works with any manifestation of |
Types of Wrappers:
A Wrapper with typing support modifying the environments observation. |
|
A Wrapper with typing support modifying the agents action. |
|
A Wrapper with typing support modifying the reward before passed to the agent. |
|
Handles dynamic registration of Wrapper sub-classes. |
Built-in Wrappers¶
Below you find the reference documentation for environment wrappers.
General Wrappers:
A statistics logging wrapper for |
|
A MazeEnv monitoring wrapper logging events for observations, actions and rewards. |
|
An observation visualization wrapper allows to apply custom observation visualization functions which are then shown in Tensorboard. |
|
Wrapper to limit the environment step count, equivalent to gym.wrappers.time_limit. |
|
A wrapper skipping the first few steps by taking random actions. |
|
This class wraps a given StructuredEnvSpacesMixin env to ensure that all observation- and action-spaces are sorted alphabetically. |
|
Wraps observations and actions by replacing dictionary spaces with the sole contained sub-space. |
ObservationWrappers:
Wraps a single observation into a dictionary space. |
|
An wrapper stacking the observations of multiple subsequent time steps. |
|
Wraps observations by replacing the dictionary observation space with the sole contained sub-space. |
ActionWrappers:
Wraps either a single action space or a tuple action space into dictionary space. |
|
Wraps actions by replacing the dictionary action space with the sole contained sub-space. |
|
Splits an actions into separate ones. |
|
The DiscretizeActionsWrapper provides functionality for discretizing individual continuous actions into discrete |
RewardWrappers:
Scales original step reward by a multiplicative scaling factor. |
|
Clips original step reward to range [min, max]. |
|
Normalizes step reward by dividing through the standard deviation of the discounted return. |
Observation Pre-Processing Wrapper¶
Below you find the reference documentation for observation pre-processing. Here you can find a more extensive write up on how to work with the observation pre-processing package.
These are interfaces and components required for observation pre-processing:
An observation pre-processing wrapper. |
|
Interface for observation pre-processors. |
These are the available built-in maze.pre_processors compatible with the PreProcessingWrapper:
An array flattening pre-processor. |
|
An one-hot encoding pre-processor for categorical features. |
|
An image resizing pre-processor. |
|
An array transposition pre-processor. |
|
An un-squeeze pre-processor. |
|
An rgb-to-gray-scale conversion pre-processor. |
Observation Normalization Wrapper¶
Below you find the reference documentation for observation normalization. Here you can find a more extensive write up on how to work with the observation normalization package.
These are interfaces and utility functions required for observation normalization:
An observation normalization wrapper. |
|
Abstract base class for normalization strategies. |
|
Obtain the normalization statistics of a given environment. |
|
Helper function estimating normalization statistics. |
|
Wrap an existing env factory to assign the passed normalization statistics. |
These are the available built-in maze.normalization_strategies compatible with the ObservationNormalizationWrapper:
Normalizes observations to have zero mean and standard deviation one. |
|
Normalizes observations to value range [0, 1]. |
Gym Environment Wrapper¶
Below you find the reference documentation for wrapping gym environments. Here you can find a more extensive write up on how to integrate Gym environments within Maze.
These are the contained components:
Wraps a Gym env into a Maze environment. |
|
Initializes a |
|
Wraps a Gym environment into a maze core environment. |
|
A Maze-style Gym renderer. |
|
A dummy conversion interface asserting that the observation is packed into a dictionary space. |
|
A dummy conversion interface asserting that the action is packed into a dictionary space. |