Navigate:
~$GYM0.0%

Gym: Reinforcement learning algorithm development toolkit

Standard API for reinforcement learning environment interfaces.

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#379
55
AI & ML
#100
4
30 DAY RANKING TREND
ovr#379
·AI#100
STARS
37.1K
FORKS
8.7K
7D STARS
+13
7D FORKS
-2
Tags:
See Repo:
Share:

Learn more about Gym

Gym is a Python library that establishes a standard interface between reinforcement learning agents and environments. The library defines a simple API where environments are implemented as Python classes that accept actions and return observations, rewards, and termination signals. Gym includes implementations of classic control tasks, Atari games, and physics simulations, with strict versioning for reproducibility when environment implementations change. The toolkit is designed to facilitate algorithm development and comparison by removing the need for researchers to build custom environment interfaces for each new project.

Gym

1

Standardized Environment Interface

All environments implement a uniform API where agents call step() and reset() methods with consistent return signatures. Eliminates the need to write custom integration code when switching between control tasks, games, or physics simulations.

2

Strict Environment Versioning

Environments use versioned suffixes (v0, v1, etc.) that increment when implementation changes affect learning outcomes. Ensures reproducibility when comparing algorithm results across papers and prevents silent behavioral changes.

3

Modular Dependency Installation

Install environment dependencies selectively based on which environments you need. Avoid heavy dependencies like MuJoCo or Atari ROMs if using only classic control environments.


from ray.rllib.algorithms.ppo import PPOConfig

config = PPOConfig().environment("CartPole-v1")
algo = config.build_algo()

for i in range(3):
    result = algo.train()
    print(f"Iteration {i}: reward={result['env_runners']['episode_return_mean']}")

algo.stop()


v0.26.2

Minor bug fix release with render mode warnings, Atari wrapper improvements, and documentation fixes.

  • Adds warnings when trying to render without specifying the render_mode
  • Updates Atari Preprocessing such that the wrapper can be pickled
  • Github CI was hardened to such that the CI just has read permissions
  • Clarify and fix typo in GraphInstance
v0.26.1

Minor bug fixes for MuJoCo dependencies, pixel observation wrapper, and rendering issues.

  • Fixed mujoco dependency to allow only mujoco-py to be installed and used
  • PixelObservationWrapper raises exception if env.render_mode is not specified
  • Fixed bug in CarRacing where wheel colours were not correct
  • Fixed BipedalWalker where moving backwards caused different sized rendered arrays
  • Fixed truncation typo in readme API example
v0.26.0

Major API changes finalizing the core API with new video recording, improved masking, and compatibility wrapper.

  • Added save_video using moviepy to render RGB frames and updated RecordVideo, removes ansi output support
  • RandomNumberGenerator functions have been removed
  • Bump ale-py to 0.8.0 for compatibility with new core API
  • Added EnvAPICompatibility wrapper
  • Added improved Sequence, Graph and Text sample masking


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers