{"id":13771318,"url":"https://github.com/facebookresearch/mtenv","last_synced_at":"2025-05-11T03:33:11.820Z","repository":{"id":44743145,"uuid":"334282180","full_name":"facebookresearch/mtenv","owner":"facebookresearch","description":"MultiTask Environments for Reinforcement Learning.","archived":true,"fork":false,"pushed_at":"2022-08-18T16:45:50.000Z","size":197,"stargazers_count":74,"open_issues_count":3,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-17T01:37:44.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-29T22:58:44.000Z","updated_at":"2024-04-20T02:52:13.000Z","dependencies_parsed_at":"2022-08-30T10:02:25.307Z","dependency_job_id":null,"html_url":"https://github.com/facebookresearch/mtenv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fmtenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fmtenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fmtenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookresearch%2Fmtenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookresearch","download_url":"https://codeload.github.com/facebookresearch/mtenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:00:50.172Z","updated_at":"2025-05-11T03:33:11.165Z","avatar_url":"https://github.com/facebookresearch.png","language":"Python","funding_links":[],"categories":["Benchmark \u0026 Dataset"],"sub_categories":["RL \u0026 Robotics"],"readme":"[![CircleCI](https://circleci.com/gh/facebookresearch/mtenv.svg?style=svg\u0026circle-token=d507c3b95e80c67d6d4daf2d43785df654af36d1)](https://circleci.com/gh/facebookresearch/mtenv)\n![PyPI - License](https://img.shields.io/pypi/l/mtenv)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mtenv)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Zulip Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://mtenv.zulipchat.com)\n\n\n# MTEnv\nMultiTask Environments for Reinforcement Learning.\n\n## Contents\n\n1. [Introduction](#Introduction)\n\n2. [Installation](#Installation)\n\n3. [Usage](#Usage)\n\n4. [Documentation](#Documentation)\n\n5. [Contributing to MTEnv](#Contributing-to-MTEnv)\n\n6. [Community](#Community)\n\n7. [Acknowledgements](#Acknowledgements)\n\n## Introduction\n\nMTEnv is a library to interface with environments for multi-task reinforcement learning. It has two main components:\n\n* A core API/interface that extends the [gym interface](https://gym.openai.com/) and adds first-class support for multi-task RL.\n\n* A [collection of environments](https://mtenv.readthedocs.io/en/latest/pages/envs/supported.html) that implement the API.\n\nTogether, these two components should provide a standard interface for multi-task RL environments and make it easier to reuse components and tools across environments.\n\nYou can read more about the difference between `MTEnv` and single-task environments [here.](https://mtenv.readthedocs.io/en/latest/pages/readme.html#multitask-observation)\n\n### List of publications \u0026 submissions using MTEnv (please create a pull request to add the missing entries):\n\n* [Learning Adaptive Exploration Strategies in Dynamic Environments Through Informed Policy Regularization](https://arxiv.org/abs/2005.02934)\n\n* [Learning Robust State Abstractions for Hidden-Parameter Block MDPs](https://arxiv.org/abs/2007.07206)\n\n* [Multi-Task Reinforcement Learning with Context-based Representations](https://arxiv.org/abs/2102.06177)\n\n### License\n\n* MTEnv uses [MIT License](https://github.com/facebookresearch/mtenv/blob/main/LICENSE).\n\n* [Terms of Use](https://opensource.facebook.com/legal/terms)\n\n* [Privacy Policy](https://opensource.facebook.com/legal/privacy)\n\n### Citing MTEnv\n\nIf you use MTEnv in your research, please use the following BibTeX entry:\n```\n@Misc{Sodhani2021MTEnv,\n  author =       {Shagun Sodhani and Ludovic Denoyer and Pierre-Alexandre Kamienny and Olivier Delalleau},\n  title =        {MTEnv - Environment interface for mulit-task reinforcement learning},\n  howpublished = {Github},\n  year =         {2021},\n  url =          {https://github.com/facebookresearch/mtenv}\n}\n```\n\n## Installation\n\nMTEnv has two components - a core API and environments that implement the API.\n\nThe **Core API** can be installed via `pip install mtenv` or `pip install git+https://github.com/facebookresearch/mtenv.git@main#egg=mtenv` \n\nThe **list of environments**, that implement the API, is available [here](https://mtenv.readthedocs.io/en/latest/pages/envs/supported.html). Any of these environments can be installed via `pip install git+https://github.com/facebookresearch/mtenv.git@main#egg=\"mtenv[env_name]\"`. For example, the `MetaWorld` environment can be installed via `pip install git+https://github.com/facebookresearch/mtenv.git@main#egg=\"mtenv[metaworld]\"`.\n\nAll the environments can be installed at once using `pip install git+https://github.com/facebookresearch/mtenv.git@main#egg=\"mtenv[all]\"`. However, note that some environments may have incompatible dependencies.\n\nMTEnv can also be installed from the source by first cloning the repo (`git clone git@github.com:facebookresearch/mtenv.git`), *cding* into the directory `cd mtenv`, and then using the pip commands as described above. For example, `pip install mtenv` to install the core API, and `pip install \"mtenv[env_name]\"` to install a particular environment.\n\n## Usage\n\nMTEnv provides an interface very similar to the standard gym environments. One key difference between multi-task environments (that implement the MTEnv interface) and single-task environments is in terms of observation that they return.\n\n### MultiTask Observation\n\nThe multi-task environments return a dictionary as the observation. This dictionary has two keys: (i) `env_obs`, which maps to the observation from the environment (i.e., the observation that a single task environments return), and (ii) `task_obs`, which maps to the task-specific information from the environment. In the simplest case, `task_obs` can be an integer denoting the task index. In other cases, `task_obs` can provide richer information.\n\n```\nfrom mtenv import make\nenv = make(\"MT-MetaWorld-MT10-v0\")\nobs = env.reset()\nprint(obs)\n# {'env_obs': array([-0.03265039,  0.51487777,  0.2368754 , -0.06968209,  0.6235982 ,\n#    0.01492813,  0.        ,  0.        ,  0.        ,  0.03933976,\n#    0.89743189,  0.01492813]), 'task_obs': 1}\naction = env.action_space.sample()\nprint(action)\n# array([-0.76422   , -0.15384133,  0.74575615, -0.11724994], dtype=float32)\nobs, reward, done, info = env.step(action)\nprint(obs)\n# {'env_obs': array([-0.02583682,  0.54065546,  0.22773503, -0.06968209,  0.6235982 ,\n#    0.01494118,  0.        ,  0.        ,  0.        ,  0.03933976,\n#    0.89743189,  0.01492813]), 'task_obs': 1}\n```\n\n## Documentation\n\n[https://mtenv.readthedocs.io](https://mtenv.readthedocs.io)\n\n## Contributing to MTEnv\n\nThere are several ways to contribute to MTEnv.\n\n1. Use MTEnv in your research.\n\n2. Contribute a new environment. We support [many environments](https://mtenv.readthedocs.io/en/latest/pages/envs/supported.html) via MTEnv and are looking forward to adding more environments. Contributors will be added as authors of the library. You can learn more about the workflow of adding an environment [here.](https://mtenv.readthedocs.io/en/latest/pages/envs/create.html)\n\n3. Check out the [good-first-issues](https://github.com/facebookresearch/mtenv/pulls?q=is%3Apr+is%3Aopen+label%3A%22good+first+issue%22) on GitHub and contribute to fixing those issues.\n\n4. Check out additional details [here](https://github.com/facebookresearch/mtenv/blob/main/.github/CONTRIBUTING.md).\n\n## Community\n\nAsk questions in the chat or github issues:\n* [Chat](https://mtenv.zulipchat.com)\n* [Issues](https://github.com/facebookresearch/mtenv/issues)\n\n## Acknowledgements\n\n* Project file pre-commit, mypy config, towncrier config, circleci etc are based on same files from [Hydra](https://github.com/facebookresearch/hydra).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fmtenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookresearch%2Fmtenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookresearch%2Fmtenv/lists"}