flâneur — a map of the web's best reading

Implementing Custom Wrappers - Gymnasium Documentation

gymnasium.farama.org · 948 words · saved by 1 readers

In this tutorial we will describe how to implement your own custom wrappers. Wrappers are a great way to add functionality to your environments in a modular way. This will save you a lot of boilerplate code. We will show how to create a wrapper by Inheriting from gymnasium.ObservationWrapper Inheriting from gymnasium.ActionWrapper Inheriting from gymnasium.RewardWrapper Inheriting from gymnasium.Wrapper Before following this tutorial, make sure to check out the docs of the gymnasium.wrappers module. Observation wrappers are useful if you want to apply some function to the observations that are returned by an environment. If you implement an observation wrapper, you only need to define this transformation by implementing the gymnasium.ObservationWrapper.observation() method. Moreover, you should remember to update the observation space, if the transformation changes the shape of observations (e.g. by transforming dictionaries into numpy arrays, as in the following example). Imagine you

Note This tutorial is compatible with Gymnasium version 1.3.0. Implementing Custom Wrappers ¶ In this tutorial we will describe how to implement your own custom wrappers. Wrappers are a great way to add functionality to your environments in a modular way. This will save you a lot of boilerplate code. We will show how to create a wrapper by Inheriting from gymnasium.ObservationWrapper Inheriting from gymnasium.ActionWrapper Inheriting from gymnasium.RewardWrapper Inheriting from gymnasium.Wrapper Before following this tutorial, make sure to check out the docs of the gymnasium.wrappers module. I

Explore this link on the map →

related reading