mo-gymnasium


Namemo-gymnasium JSON
Version 1.3.1 PyPI version JSON
download
home_pageNone
SummaryA standard API for MORL and a diverse set of reference environments.
upload_time2024-10-28 18:32:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License
keywords reinforcement learning multi-objective rl ai gymnasium
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python](https://img.shields.io/pypi/pyversions/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium)
[![PyPI](https://badge.fury.io/py/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium)
![tests](https://github.com/Farama-Foundation/mo-gymnasium/workflows/Python%20tests/badge.svg)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<p align="center">
    <img src="docs/_static/img/MO-Gymnasium-text_small.png" width="500px"/>
</p>

<!-- start elevator-pitch -->

MO-Gymnasium is an open source Python library for developing and comparing multi-objective 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. Essentially, the environments follow the standard [Gymnasium API](https://github.com/Farama-Foundation/Gymnasium), but return vectorized rewards as numpy arrays.

The documentation website is at [mo-gymnasium.farama.org](https://mo-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.

<!-- end elevator-pitch -->

## Environments

MO-Gymnasium includes environments taken from the MORL literature, as well as multi-objective version of classical environments, such as MuJoco.
The full list of environments is available [here](https://mo-gymnasium.farama.org/environments/all-environments/).

## Installation
<!-- start install -->

To install MO-Gymnasium, use:
```bash
pip install mo-gymnasium
```

This does not include dependencies for all families of environments (some can be problematic to install on certain systems). You can install these dependencies for one family like `pip install "mo-gymnasium[mujoco]"` or use `pip install "mo-gymnasium[all]"` to install all dependencies.

<!-- end install -->

## API

<!-- start snippet-usage -->

As for Gymnasium, the MO-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 "minecart-v0" environment:

```python
import gymnasium as gym
import mo_gymnasium as mo_gym
import numpy as np

# It follows the original Gymnasium API ...
env = mo_gym.make('minecart-v0')

obs, info = env.reset()
# but vector_reward is a numpy array!
next_obs, vector_reward, terminated, truncated, info = env.step(your_agent.act(obs))

# Optionally, you can scalarize the reward function with the LinearReward wrapper
env = mo_gym.wrappers.LinearReward(env, weight=np.array([0.8, 0.2, 0.2]))
```
For details on multi-objective MDP's (MOMDP's) and other MORL definitions, see [A practical guide to multi-objective reinforcement learning and planning](https://link.springer.com/article/10.1007/s10458-022-09552-y).

You can also check more examples in this colab notebook! [![MO-Gym Demo in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Farama-Foundation/MO-Gymnasium/blob/main/mo_gymnasium_demo.ipynb)

<!-- end snippet-usage -->

## Notable related libraries

[MORL-Baselines](https://github.com/LucasAlegre/morl-baselines) is a repository containing various implementations of MORL algorithms by the same authors as MO-Gymnasium. It relies on the MO-Gymnasium API and shows various examples of the usage of wrappers and environments.

## Environment Versioning

MO-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.

## Development Roadmap
We have a roadmap for future development available here: https://github.com/Farama-Foundation/MO-Gymnasium/issues/66.

## Project Maintainers

Project Managers: [Lucas Alegre](https://github.com/LucasAlegre) and [Florian Felten](https://github.com/ffelten).

Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).

## Citing

<!-- start citation -->

If you use this repository in your research, please cite:

```bibtex
@inproceedings{felten_toolkit_2023,
	author = {Felten, Florian and Alegre, Lucas N. and Now{\'e}, Ann and Bazzan, Ana L. C. and Talbi, El Ghazali and Danoy, Gr{\'e}goire and Silva, Bruno C. {\relax da}},
	title = {A Toolkit for Reliable Benchmarking and Research in Multi-Objective Reinforcement Learning},
	booktitle = {Proceedings of the 37th Conference on Neural Information Processing Systems ({NeurIPS} 2023)},
	year = {2023}
}
```

<!-- end citation -->

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mo-gymnasium",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Reinforcement Learning, Multi-Objective, RL, AI, Gymnasium",
    "author": null,
    "author_email": "Farama Foundation <contact@farama.org>",
    "download_url": "https://files.pythonhosted.org/packages/2a/7e/f78700b5f276df41ecb1089bd8b376a03914eeede152884309dcaaf97ba4/mo_gymnasium-1.3.1.tar.gz",
    "platform": null,
    "description": "[![Python](https://img.shields.io/pypi/pyversions/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium)\n[![PyPI](https://badge.fury.io/py/mo-gymnasium.svg)](https://badge.fury.io/py/mo-gymnasium)\n![tests](https://github.com/Farama-Foundation/mo-gymnasium/workflows/Python%20tests/badge.svg)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n<p align=\"center\">\n    <img src=\"docs/_static/img/MO-Gymnasium-text_small.png\" width=\"500px\"/>\n</p>\n\n<!-- start elevator-pitch -->\n\nMO-Gymnasium is an open source Python library for developing and comparing multi-objective 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. Essentially, the environments follow the standard [Gymnasium API](https://github.com/Farama-Foundation/Gymnasium), but return vectorized rewards as numpy arrays.\n\nThe documentation website is at [mo-gymnasium.farama.org](https://mo-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.\n\n<!-- end elevator-pitch -->\n\n## Environments\n\nMO-Gymnasium includes environments taken from the MORL literature, as well as multi-objective version of classical environments, such as MuJoco.\nThe full list of environments is available [here](https://mo-gymnasium.farama.org/environments/all-environments/).\n\n## Installation\n<!-- start install -->\n\nTo install MO-Gymnasium, use:\n```bash\npip install mo-gymnasium\n```\n\nThis does not include dependencies for all families of environments (some can be problematic to install on certain systems). You can install these dependencies for one family like `pip install \"mo-gymnasium[mujoco]\"` or use `pip install \"mo-gymnasium[all]\"` to install all dependencies.\n\n<!-- end install -->\n\n## API\n\n<!-- start snippet-usage -->\n\nAs for Gymnasium, the MO-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 \"minecart-v0\" environment:\n\n```python\nimport gymnasium as gym\nimport mo_gymnasium as mo_gym\nimport numpy as np\n\n# It follows the original Gymnasium API ...\nenv = mo_gym.make('minecart-v0')\n\nobs, info = env.reset()\n# but vector_reward is a numpy array!\nnext_obs, vector_reward, terminated, truncated, info = env.step(your_agent.act(obs))\n\n# Optionally, you can scalarize the reward function with the LinearReward wrapper\nenv = mo_gym.wrappers.LinearReward(env, weight=np.array([0.8, 0.2, 0.2]))\n```\nFor details on multi-objective MDP's (MOMDP's) and other MORL definitions, see [A practical guide to multi-objective reinforcement learning and planning](https://link.springer.com/article/10.1007/s10458-022-09552-y).\n\nYou can also check more examples in this colab notebook! [![MO-Gym Demo in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Farama-Foundation/MO-Gymnasium/blob/main/mo_gymnasium_demo.ipynb)\n\n<!-- end snippet-usage -->\n\n## Notable related libraries\n\n[MORL-Baselines](https://github.com/LucasAlegre/morl-baselines) is a repository containing various implementations of MORL algorithms by the same authors as MO-Gymnasium. It relies on the MO-Gymnasium API and shows various examples of the usage of wrappers and environments.\n\n## Environment Versioning\n\nMO-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.\n\n## Development Roadmap\nWe have a roadmap for future development available here: https://github.com/Farama-Foundation/MO-Gymnasium/issues/66.\n\n## Project Maintainers\n\nProject Managers: [Lucas Alegre](https://github.com/LucasAlegre) and [Florian Felten](https://github.com/ffelten).\n\nMaintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).\n\n## Citing\n\n<!-- start citation -->\n\nIf you use this repository in your research, please cite:\n\n```bibtex\n@inproceedings{felten_toolkit_2023,\n\tauthor = {Felten, Florian and Alegre, Lucas N. and Now{\\'e}, Ann and Bazzan, Ana L. C. and Talbi, El Ghazali and Danoy, Gr{\\'e}goire and Silva, Bruno C. {\\relax da}},\n\ttitle = {A Toolkit for Reliable Benchmarking and Research in Multi-Objective Reinforcement Learning},\n\tbooktitle = {Proceedings of the 37th Conference on Neural Information Processing Systems ({NeurIPS} 2023)},\n\tyear = {2023}\n}\n```\n\n<!-- end citation -->\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A standard API for MORL and a diverse set of reference environments.",
    "version": "1.3.1",
    "project_urls": {
        "Bug Report": "https://github.com/Farama-Foundation/MO-Gymnasium/issues",
        "Documentation": "https://mo-gymnasium.farama.org",
        "Homepage": "https://mo-gymnasium.farama.org",
        "Repository": "https://github.com/Farama-Foundation/MO-Gymnasium"
    },
    "split_keywords": [
        "reinforcement learning",
        " multi-objective",
        " rl",
        " ai",
        " gymnasium"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fbfd485388129fe36f665ddabfbaf4b99cf5b2525f2b9f405eb686439f54db2f",
                "md5": "f452e14cd6a1e2966a465a0240f9b9a1",
                "sha256": "7f285bdfedcaedccf7833bdfb6b32157f55e29aebcaf0a58b0071244fcf1316a"
            },
            "downloads": -1,
            "filename": "mo_gymnasium-1.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f452e14cd6a1e2966a465a0240f9b9a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 479588,
            "upload_time": "2024-10-28T18:32:15",
            "upload_time_iso_8601": "2024-10-28T18:32:15.905556Z",
            "url": "https://files.pythonhosted.org/packages/fb/fd/485388129fe36f665ddabfbaf4b99cf5b2525f2b9f405eb686439f54db2f/mo_gymnasium-1.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a7ef78700b5f276df41ecb1089bd8b376a03914eeede152884309dcaaf97ba4",
                "md5": "29f570f3fab75d85ff92b3312f0003c5",
                "sha256": "e5563936cef61ce0f557c848802e7b7ce525d79312b18f08609a30c79e705375"
            },
            "downloads": -1,
            "filename": "mo_gymnasium-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "29f570f3fab75d85ff92b3312f0003c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 465953,
            "upload_time": "2024-10-28T18:32:17",
            "upload_time_iso_8601": "2024-10-28T18:32:17.616777Z",
            "url": "https://files.pythonhosted.org/packages/2a/7e/f78700b5f276df41ecb1089bd8b376a03914eeede152884309dcaaf97ba4/mo_gymnasium-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-28 18:32:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Farama-Foundation",
    "github_project": "MO-Gymnasium",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mo-gymnasium"
}
        
Elapsed time: 1.78464s