magi

Reinforcement learning library in JAX.

https://github.com/ethanluoyc/magi

Science Score: 44.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

jax machine-learning reinforcement-learning research
Last synced: 9 months ago · JSON representation ·

Repository

Reinforcement learning library in JAX.

Basic Info
  • Host: GitHub
  • Owner: ethanluoyc
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 685 KB
Statistics
  • Stars: 100
  • Watchers: 9
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Topics
jax machine-learning reinforcement-learning research
Created about 5 years ago · Last pushed over 2 years ago
Metadata Files
Readme Contributing License Citation

README.md

Magi RL library in JAX

Installation | Agents | Examples | Contributing | Documentation

pytest

Note Future development of JAX agents in Magi have moved to Corax

Magi is a RL library in JAX that is fully compatible with Acme.

In addition to the features provided by Acme, Magi offers implementation of RL agents that are not found in the Acme repository as well as providing useful tools for integrating experiment logging services such as WandB.

Note: Magi is in alpha development so expect breaking changes!

Magi currently depends on HEAD version of dm-acme instead of the latest release version on PyPI which is fairly old.

Installation

  1. Create a new Python virtual environment bash python3 -m venv venv source venv/bin/activate

  2. Install dependencies with the following commands.

```bash pip install -U pip setuptools wheel

Magi depends on latest version of dm-acme.

The dependencies in setup.py are abstract which allows you to pin

a specific version of dm-acme.

The following command installs the latest version of dm-acme

pip install 'git+https://github.com/deepmind/acme.git#egg=dm-acme[jax,tf,examples]'

Install magi in editable mode, with additional dependencies.

In case you need to run examples on GPU, you should install the

GPU version of JAX with a command like the following

pip install 'jax[cuda]<0.4' -f https://storage.googleapis.com/jax-releases/jaxcudareleases.html pip install -e '.[jax]' ```

The base installation for magi does not list TensorFlow/JAX as a dependency. However, note that JAX requires platform-specific installation (CPU/GPU and CUDA versions). Furthermore, Acme depends on Reverb and LaunchPad which requires them to be pinned against specific versions of TensorFlow. This should be handled if you use install dm-acme with [jax,tf] extras. However, you can also use install with different versions of TensorFlow/Reverb/Launchpad. In that case, you should omit the extras and find compatible versions and pin those versions accordingly.

If for some reason installation fails, first check out GitHub Actions badge to see if this fails on the latest CI run. If the CI is successful, then it's likely that there are some issues to setting up your own environment. Refer to .github/workflows/ci.yaml as the official source for how to set up the environment.

Agents

magi includes popular RL algorithm implementation such as SAC, DrQ, SAC-AE and PETS. Refer to magi/agents for a full list of agents.

Examples

Check out examples where we include examples of using our RL agents on popular benchmark tasks.

Testing

On Linux, you can run tests with nox test

Contributing

Refer to CONTRIBUTING.md.

Acknowledgements

Magi is inspired by many of the open-source RL projects out there. Here is a (non-exhaustive) list of related libraries and packages that Magi references:

  • https://github.com/deepmind/acme
  • https://github.com/ikostrikov/jaxrl
  • https://github.com/tensorflow/agents
  • https://github.com/rail-berkeley/rlkit

License

Apache License 2.0

Citation

If you use Magi in your work, please cite us according to the CITATION file. You may learn more about the CITATION file from here.

Owner

  • Name: Yicheng Luo
  • Login: ethanluoyc
  • Kind: user
  • Location: London, United Kingdom
  • Company: University College London

PhD student at UCL AI Center. Former intern at @deepmind and @secondmind-labs.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Luo"
  given-names: "Yicheng"
  orcid: "https://orcid.org/0000-0003-0547-411X"
title: "Magi: Research Reinforcement Learning Library in JAX"
version: 0.0.1
date-released: 2021-11-07
url: "https://github.com/ethanluoyc/magi"

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

magi/examples/offline/requirements.txt pypi
  • mujoco-py ==1.50.1.1
magi/projects/baselines/requirements.txt pypi
  • gym >=0.21.0
  • mujoco_py >=1.50,<2.0
  • wandb *
requirements/base.in pypi
  • PyYAML *
  • absl-py *
  • chex *
  • dm-acme *
  • dm-haiku *
  • dm-launchpad *
  • dm-reverb *
  • dm-tree *
  • gym *
  • jax ==0.3.6
  • ml_collections *
  • numpy *
  • optax *
  • rlax *
  • tensorflow ==2.8.0
  • tensorflow_probability ==0.15.0
  • wandb *
requirements/base.txt pypi
  • 104 dependencies
requirements/dev.in pypi
  • isort *
  • nox *
  • pip-compile-multi *
  • pre-commit *
  • pylint *
  • pytype *
  • yapf *
requirements/dev.txt pypi
  • argcomplete ==1.12.3
  • astroid ==2.11.6
  • cfgv ==3.3.1
  • colorlog ==6.6.0
  • distlib ==0.3.4
  • filelock ==3.7.1
  • identify ==2.5.1
  • importlab ==0.7
  • isort ==5.10.1
  • lazy-object-proxy ==1.7.1
  • libcst ==0.4.5
  • mccabe ==0.7.0
  • mypy-extensions ==0.4.3
  • networkx ==2.8.3
  • ninja ==1.10.2.3
  • nodeenv ==1.6.0
  • nox ==2022.1.7
  • pep517 ==0.12.0
  • pip-compile-multi ==2.4.5
  • pip-tools ==6.6.2
  • platformdirs ==2.5.2
  • pre-commit ==2.19.0
  • pydot ==1.4.2
  • pylint ==2.14.2
  • pytype ==2022.6.14
  • toml ==0.10.2
  • tomlkit ==0.11.0
  • toposort ==1.7
  • typing-inspect ==0.7.1
  • virtualenv ==20.14.1
  • yapf ==0.32.0
requirements/tests.in pypi
  • pytest *
  • pytest-xdist *
requirements/tests.txt pypi
  • execnet ==1.9.0
  • iniconfig ==1.1.1
  • pluggy ==1.0.0
  • py ==1.11.0
  • pytest ==7.1.2
  • pytest-forked ==1.4.0
  • pytest-xdist ==2.5.0
  • tomli ==2.0.1
setup.py pypi
  • DeepMind *
  • JAX *
  • Tensorflow *
  • absl-py *
  • chex *
  • dm-acme *
  • dm-haiku *
  • dm-launchpad *
  • dm-reverb *
  • jax *
  • numpy *
  • optax *
  • rlax *
  • tensorflow *
  • tensorflow_probability *