Navigate:
~$GYM0.0%

Gym: Reinforcement learning algorithm development toolkit

Standard API for reinforcement learning environment interfaces.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#223
39
AI & ML
#79
3
30 DAY RANKING TREND
ovr#223
·AI#79
STARS
36.9K
FORKS
8.7K
DOWNLOADS
66
7D STARS
+8
7D FORKS
-1
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.


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

Bug-fix release preserving final step info in vector environments and adding render warnings; no breaking changes.

  • Check vector environment code: final obs/info now nested under 'final_observation' and 'final_info' keys in the returned info dict.
  • Expect new warnings if calling render without specifying render_mode during environment initialization.
v0.26.1

Bug fix release restoring mujoco-py-only installs and correcting render-mode checks in wrappers.

  • Remove hard mujoco dependency if using mujoco-py alone; PixelObservationWrapper now requires env.render_mode set.
  • Fix CarRacing wheel colors and BipedalWalker backward-movement render array size inconsistencies.
v0.26.0

Final major API overhaul enforces step termination/truncation split, reset info, no seed function, and render mode at init; use EnvCompatibility wrapper for old v21/22 envs.

  • Update all step calls to handle 5 return values (obs, reward, termination, truncation, info) and reset to return (obs, info).
  • Pass render_mode during gym.make initialization instead of to render() and remove any Env.seed calls in favor of reset(seed=...).

See how people are using gym

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers