OpenAI Gym API

The Python library called Gym was developed and has been maintained by OpenAI ( The main goal of Gym is to provide a rich collection of environments for RL experiments using a unified interface. So, it's not surprising that the central class in the library is an environment, which is called Env. It exposes several methods and fields that provide the required information about an environment's capabilities. From high level, every environment provides you with these pieces of information and functionality:

  • A set of actions that are allowed to be executed in an environment. Gym supports both discrete and continuous actions, as well as their combination.
  • The shape and boundaries of the observations that an environment ...

Get Deep Reinforcement Learning Hands-On now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.