Skip to main content

Implementation of modern IRL and imitation learning algorithms.

Project description

CircleCI Documentation Status codecov PyPI version

Imitation Learning Baseline Implementations

This project aims to provide clean implementations of imitation learning algorithms. Currently we have implementations of AIRL and GAIL, and intend to add more in the future.

To install:

conda create -n imitation python=3.8  # python 3.7 and virtualenv are also okay.
conda activate imitation
pip install -e '.[dev]'  # install `imitation` in developer mode

Optional Mujoco Dependency:

Follow instructions to install mujoco_py v1.5 here.

To run:

# Train PPO2 agent on cartpole and collect expert demonstrations
python -m imitation.scripts.expert_demos with cartpole
# Train AIRL on from demonstrations
python -m imitation.scripts.train_adversarial with cartpole airl

View Tensorboard with tensorboard --logdir output/.

Contributing

Please follow a coding style of:

  • PEP8, with line width 88.
  • Use the black autoformatter.
  • Follow the Google Python Style Guide unless it conflicts with the above. Examples of Google-style docstrings can be found here.

PRs should include unit tests for any new features, and add type annotations where possible. It is OK to omit annotations when it would make the code significantly more complex.

We use pytest for unit testing: run pytest tests/ to run the test suite. We use pytype for static type analysis. You should run ci/code_checks.sh to run linting and static type checks, and may wish to configure this as a Git pre-commit hook.

These checks are run on CircleCI and are required to pass before merging. Additionally, we track test coverage by CodeCov, and mandate that code coverage should not decrease. This can be overridden by maintainers in exceptional cases. Files in imitation/{examples,scripts}/ have no coverage requirements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imitation-0.1.0.tar.gz (89.2 kB view hashes)

Uploaded Source

Built Distribution

imitation-0.1.0-py3-none-any.whl (113.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page