gymnasium

An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)

https://github.com/farama-foundation/gymnasium

Science Score: 46.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    32 of 538 committers (5.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

api gym reinforcement-learning

Keywords from Contributors

jax transformer cryptocurrency gym-environment optimizing-compiler closember cryptography tensor automatic-differentiation unit-testing
Last synced: 6 months ago · JSON representation

Repository

An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)

Basic Info
  • Host: GitHub
  • Owner: Farama-Foundation
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage: https://gymnasium.farama.org
  • Size: 340 MB
Statistics
  • Stars: 9,988
  • Watchers: 60
  • Forks: 1,098
  • Open Issues: 78
  • Releases: 16
Topics
api gym reinforcement-learning
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation

README.md

Python PyPI arXiv pre-commit License Code style: black

Gymnasium is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. This is a fork of OpenAI's Gym library by its maintainers (OpenAI handed over maintenance a few years ago to an outside team), and is where future maintenance will occur going forward.

The documentation website is at gymnasium.farama.org, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6

Environments

Gymnasium includes the following families of environments along with a wide variety of third-party environments * Classic Control - These are classic reinforcement learning based on real-world problems and physics. * Box2D - These environments all involve toy games based around physics control, using box2d based physics and PyGame-based rendering * Toy Text - These environments are designed to be extremely simple, with small discrete state and action spaces, and hence easy to learn. As a result, they are suitable for debugging implementations of reinforcement learning algorithms. * MuJoCo - A physics engine based environments with multi-joint control which are more complex than the Box2D environments. * Atari - Emulator of Atari 2600 ROMs simulated that have a high range of complexity for agents to learn. * Third-party - A number of environments have been created that are compatible with the Gymnasium API. Be aware of the version that the software was created for and use the apply_env_compatibility in gymnasium.make if necessary.

Installation

To install the base Gymnasium library, use pip install gymnasium

This does not include dependencies for all families of environments (there's a massive number, and some can be problematic to install on certain systems). You can install these dependencies for one family like pip install "gymnasium[atari]" or use pip install "gymnasium[all]" to install all dependencies.

We support and test for Python 3.10, 3.11, 3.12 and 3.13 on Linux and macOS. We will accept PRs related to Windows, but do not officially support it.

API

The Gymnasium API models environments as simple Python env classes. Creating environment instances and interacting with them is very simple- here's an example using the "CartPole-v1" environment:

```python import gymnasium as gym env = gym.make("CartPole-v1")

observation, info = env.reset(seed=42) for _ in range(1000): action = env.action_space.sample() observation, reward, terminated, truncated, info = env.step(action)

if terminated or truncated:
    observation, info = env.reset()

env.close() ```

Notable Related Libraries

Please note that this is an incomplete list, and just includes libraries that the maintainers most commonly point newcomers to when asked for recommendations.

  • CleanRL is a learning library based on the Gymnasium API. It is designed to cater to newer people in the field and provides very good reference implementations.
  • PettingZoo is a multi-agent version of Gymnasium with a number of implemented environments, i.e. multi-agent Atari environments.
  • The Farama Foundation also has a collection of many other environments that are maintained by the same team as Gymnasium and use the Gymnasium API.

Environment Versioning

Gymnasium keeps strict versioning for reproducibility reasons. All environments end in a suffix like "-v0". When changes are made to environments that might impact learning results, the number is increased by one to prevent potential confusion. These were inherited from Gym.

Support Gymnasium's Development

If you are financially able to do so and would like to support the development of Gymnasium, please join others in the community in donating to us.

Citation

You can cite Gymnasium using our related paper (https://arxiv.org/abs/2407.17032) as:

@article{towers2024gymnasium, title={Gymnasium: A Standard Interface for Reinforcement Learning Environments}, author={Towers, Mark and Kwiatkowski, Ariel and Terry, Jordan and Balis, John U and De Cola, Gianluca and Deleu, Tristan and Goul{\~a}o, Manuel and Kallinteris, Andreas and Krimmel, Markus and KG, Arjun and others}, journal={arXiv preprint arXiv:2407.17032}, year={2024} }

Owner

  • Name: Farama Foundation
  • Login: Farama-Foundation
  • Kind: organization
  • Email: contact@farama.org

The Farama foundation is a nonprofit organization working to develop and maintain open source reinforcement learning tools.

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 2,427
  • Total Committers: 538
  • Avg Commits per committer: 4.511
  • Development Distribution Score (DDS): 0.894
Past Year
  • Commits: 163
  • Committers: 77
  • Avg Commits per committer: 2.117
  • Development Distribution Score (DDS): 0.755
Top Committers
Name Email Commits
Mark Towers m****s@g****m 257
Greg Brockman g****b@g****m 198
J K Terry j****y@g****m 132
Jie Tang j****g@o****m 121
Kallinteris Andreas 3****s 111
Peter Zhokhov p****z@o****m 102
Jonas Schneider m****l@j****m 62
Ariel Kwiatkowski a****i@g****m 59
Xingdong Zuo z****g 52
John Schulman j****u@o****m 46
Trevor Blackwell t****b@t****g 44
Christopher Hesse c****e 39
Manuel Goulão m****o@g****m 35
Omar Younis 4****k 31
Markus Krimmel m****l@g****m 27
Tom Brown n****n@g****m 25
Rafael Cosman r****n@a****u 25
Tristan Deleu t****u 24
Jet 3****s 24
Philip Paquette p****e@g****m 18
Iaroslav Shcherbatyi i****s@g****m 18
Jesse Farebrother j****o@g****m 17
Elijah K i****v@g****m 15
Szymon Sidor s****n@o****m 14
Gianluca De Cola 4****a 14
Costa Huang c****g@o****m 14
InstanceLabs i****1 14
Elliot Tower 3****r 14
trigaten s****5@h****m 13
Oleg Klimov o****h@g****m 13
and 508 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 412
  • Total pull requests: 713
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 282
  • Total pull request authors: 174
  • Average comments per issue: 3.41
  • Average comments per pull request: 1.38
  • Merged pull requests: 547
  • Bot issues: 0
  • Bot pull requests: 12
Past Year
  • Issues: 95
  • Pull requests: 215
  • Average time to close issues: 7 days
  • Average time to close pull requests: 10 days
  • Issue authors: 82
  • Pull request authors: 81
  • Average comments per issue: 2.16
  • Average comments per pull request: 1.52
  • Merged pull requests: 162
  • Bot issues: 0
  • Bot pull requests: 8
Top Authors
Issue Authors
  • Kallinteris-Andreas (23)
  • pseudo-rnd-thoughts (14)
  • TimSchneider42 (6)
  • RedTachyon (6)
  • PBerit (5)
  • sparisi (5)
  • RogerJL (5)
  • jamartinh (5)
  • sven1977 (4)
  • ArshiaIlaty (4)
  • vmoens (4)
  • Omer1Yuval1 (4)
  • zichunxx (3)
  • jjshoots (3)
  • qgallouedec (3)
Pull Request Authors
  • pseudo-rnd-thoughts (206)
  • Kallinteris-Andreas (174)
  • RedTachyon (23)
  • dependabot[bot] (16)
  • TimSchneider42 (14)
  • elliottower (13)
  • amacati (12)
  • traversaro (11)
  • RogerJL (11)
  • JDRanpariya (11)
  • jjshoots (10)
  • foreverska (8)
  • robertoschiavone (7)
  • Jammf (6)
  • CloseChoice (6)
Top Labels
Issue Labels
bug (179) question (114) enhancement (83) good first issue (7) help wanted (2) before-1.0 (2) CANT-FIX (1) wontfix (1) documentation (1)
Pull Request Labels
dependencies (16) github_actions (8) bug (1)

Packages

  • Total packages: 5
  • Total downloads:
    • pypi 4,801,276 last-month
  • Total docker downloads: 25,798,128
  • Total dependent packages: 317
    (may contain duplicates)
  • Total dependent repositories: 559
    (may contain duplicates)
  • Total versions: 60
  • Total maintainers: 3
pypi.org: gymnasium

A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym).

  • Versions: 16
  • Dependent Packages: 316
  • Dependent Repositories: 555
  • Downloads: 4,801,276 Last month
  • Docker Downloads: 25,798,128
Rankings
Dependent packages count: 0.2%
Downloads: 0.5%
Dependent repos count: 0.6%
Stargazers count: 1.3%
Average: 1.4%
Forks count: 2.6%
Docker downloads count: 2.9%
Maintainers (3)
Last synced: 6 months ago
proxy.golang.org: github.com/farama-foundation/gymnasium
  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 0.6%
Forks count: 0.9%
Average: 3.7%
Dependent packages count: 6.5%
Dependent repos count: 6.9%
Last synced: 6 months ago
proxy.golang.org: github.com/Farama-Foundation/Gymnasium
  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 0.6%
Forks count: 0.9%
Average: 3.7%
Dependent packages count: 6.5%
Dependent repos count: 6.9%
Last synced: 6 months ago
proxy.golang.org: github.com/farama-Foundation/gymnasium
  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 6 months ago
anaconda.org: gymnasium

Gymnasium is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. This is a fork of OpenAI's Gym library by the maintainers (OpenAI handed over maintenance a few years ago to an outside team), and is where future maintenance will occur going forward

  • Versions: 2
  • Dependent Packages: 1
  • Dependent Repositories: 4
Rankings
Stargazers count: 17.9%
Dependent packages count: 21.6%
Forks count: 22.2%
Average: 26.5%
Dependent repos count: 44.3%
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • furo *
  • moviepy *
  • myst-parser *
  • pygame *
  • sphinx *
  • sphinx-autobuild *
  • sphinx-gallery ==0.14.0
  • sphinx_github_changelog *
pyproject.toml pypi
  • cloudpickle >=1.2.0
  • farama-notifications >=0.0.1
  • importlib-metadata >=4.8.0; python_version < '3.10'
  • numpy >=1.21.0
  • typing-extensions >=4.3.0
setup.py pypi
.github/workflows/docs-build-dev.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/docs-build-release.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/docs-manual-build.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/pypi-publish.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/run-pre-commit.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/run-pytest.yml actions
  • actions/checkout v4 composite