├── .dockerignore ├── src └── imitation │ ├── py.typed │ ├── scripts │ ├── config │ │ ├── __init__.py │ │ ├── tuned_hps │ │ │ ├── fast_dagger_seals_cartpole.json │ │ │ ├── bc_seals_ant_best_hp_eval.json │ │ │ ├── bc_seals_hopper_best_hp_eval.json │ │ │ ├── bc_seals_swimmer_best_hp_eval.json │ │ │ ├── bc_seals_walker_best_hp_eval.json │ │ │ ├── bc_seals_half_cheetah_best_hp_eval.json │ │ │ ├── dagger_seals_ant_best_hp_eval.json │ │ │ ├── dagger_seals_swimmer_best_hp_eval.json │ │ │ ├── dagger_seals_hopper_best_hp_eval.json │ │ │ ├── dagger_seals_walker_best_hp_eval.json │ │ │ ├── dagger_seals_half_cheetah_best_hp_eval.json │ │ │ ├── gail_seals_ant_best_hp_eval.json │ │ │ ├── airl_seals_ant_best_hp_eval.json │ │ │ ├── gail_seals_half_cheetah_best_hp_eval.json │ │ │ ├── airl_seals_half_cheetah_best_hp_eval.json │ │ │ ├── gail_seals_hopper_best_hp_eval.json │ │ │ ├── airl_seals_hopper_best_hp_eval.json │ │ │ ├── gail_seals_swimmer_best_hp_eval.json │ │ │ ├── gail_seals_walker_best_hp_eval.json │ │ │ ├── airl_seals_swimmer_best_hp_eval.json │ │ │ └── airl_seals_walker_best_hp_eval.json │ │ ├── analyze.py │ │ ├── parallel.py │ │ ├── train_imitation.py │ │ └── eval_policy.py │ ├── ingredients │ │ ├── __init__.py │ │ ├── sqil.py │ │ ├── wb.py │ │ ├── expert.py │ │ ├── policy.py │ │ ├── bc.py │ │ └── policy_evaluation.py │ ├── __init__.py │ └── convert_trajs.py │ ├── util │ ├── __init__.py │ ├── sacred_file_parsing.py │ ├── video_wrapper.py │ └── registry.py │ ├── algorithms │ ├── __init__.py │ └── adversarial │ │ └── __init__.py │ ├── regularization │ └── __init__.py │ ├── rewards │ ├── __init__.py │ └── reward_function.py │ ├── policies │ ├── __init__.py │ ├── exploration_wrapper.py │ └── replay_buffer_wrapper.py │ ├── testing │ ├── __init__.py │ ├── reward_nets.py │ └── reward_improvement.py │ ├── data │ ├── __init__.py │ └── serialize.py │ └── __init__.py ├── docs ├── .gitignore ├── main-concepts │ └── benchmarks.md ├── _static │ └── css │ │ └── custom.css ├── _templates │ └── autosummary │ │ ├── base.rst │ │ ├── class.rst │ │ └── module.rst ├── development │ ├── license.rst │ ├── release-notes.rst │ └── contributing │ │ ├── index.rst │ │ └── code-of-conduct.rst ├── Makefile ├── make.bat ├── getting-started │ ├── installation.rst │ ├── first_steps.rst │ └── what_is_imitation.rst ├── algorithms │ ├── sqil.rst │ ├── bc.rst │ ├── mce_irl.rst │ ├── dagger.rst │ ├── density.rst │ ├── gail.rst │ └── airl.rst └── index.rst ├── experiments ├── .gitignore ├── imit_table_cheetahs.csv ├── imit_table_mvp_seals_config.csv ├── rollouts_from_policies_config.csv ├── common.sh ├── imit_benchmark_config.csv ├── convert_traj.py ├── README.md ├── rollouts_from_policies.sh ├── bc_benchmark.sh ├── benchmark_and_table.sh ├── transfer_learn_benchmark.sh └── dagger_benchmark.sh ├── tests ├── testdata │ ├── rollouts_from_policies_config.csv │ ├── imit_benchmark_config.csv │ ├── expert_models │ │ ├── cartpole_0 │ │ │ ├── rollouts │ │ │ │ └── final.npz │ │ │ └── policies │ │ │ │ └── final │ │ │ │ └── model.zip │ │ └── pendulum_0 │ │ │ └── rollouts │ │ │ └── final.npz │ ├── npz_format_rollout.npz │ └── pickle_format_rollout.pkl ├── algorithms │ ├── __init__.py │ └── conftest.py ├── generate_test_data.sh ├── util │ ├── test_registry.py │ └── test_sacred_file_parsing.py ├── conftest.py ├── rewards │ ├── test_reward_fn.py │ └── test_reward_wrapper.py ├── test_benchmarking.py ├── scripts │ └── ingredients │ │ └── test_rewards.py └── test_examples.py ├── .coveragerc ├── .github ├── pull_request_template.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── publish-to-pypi.yml ├── .gitattributes ├── mypy.ini ├── ci ├── build_and_activate_venv.ps1 ├── build_and_activate_venv.sh ├── Xdummy-entrypoint.py └── check_typeignore.py ├── .readthedocs.yml ├── CITATION.bib ├── pyproject.toml ├── examples ├── quickstart.sh ├── train_dagger_atari_interactive_policy.py └── quickstart.py ├── .codecov.yml ├── benchmarking ├── run_benchmark_on_slurm.sh ├── sacred_output_to_csv.py └── run_all_benchmarks_on_slurm.sh ├── LICENSE ├── runners ├── launch_docker-dev.sh └── build_push_image.sh ├── setup.cfg ├── Dockerfile ├── .gitignore └── .pre-commit-config.yaml /.dockerignore: -------------------------------------------------------------------------------- 1 | .gitignore -------------------------------------------------------------------------------- /src/imitation/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _api 2 | -------------------------------------------------------------------------------- /experiments/.gitignore: -------------------------------------------------------------------------------- 1 | figures/ 2 | -------------------------------------------------------------------------------- /docs/main-concepts/benchmarks.md: -------------------------------------------------------------------------------- 1 | ../../benchmarking/README.md -------------------------------------------------------------------------------- /src/imitation/scripts/config/__init__.py: -------------------------------------------------------------------------------- 1 | """Configuration settings for scripts.""" 2 | -------------------------------------------------------------------------------- /src/imitation/scripts/ingredients/__init__.py: -------------------------------------------------------------------------------- 1 | """Ingredients for Sacred experiments.""" 2 | -------------------------------------------------------------------------------- /experiments/imit_table_cheetahs.csv: -------------------------------------------------------------------------------- 1 | env_config_name,n_expert_demos 2 | seals_half_cheetah,40 3 | -------------------------------------------------------------------------------- /src/imitation/util/__init__.py: -------------------------------------------------------------------------------- 1 | """General utility functions: e.g. logging, configuration, etc.""" 2 | -------------------------------------------------------------------------------- /src/imitation/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | """Implementations of imitation and reward learning algorithms.""" 2 | -------------------------------------------------------------------------------- /tests/testdata/rollouts_from_policies_config.csv: -------------------------------------------------------------------------------- 1 | env_config_name,n_demonstrations 2 | seals_cartpole,1 3 | -------------------------------------------------------------------------------- /tests/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | """This is just here to make mypy stop complaining about duplicate conftests.""" 2 | -------------------------------------------------------------------------------- /src/imitation/algorithms/adversarial/__init__.py: -------------------------------------------------------------------------------- 1 | """Adversarial imitation learning algorithms, AIRL and GAIL.""" 2 | -------------------------------------------------------------------------------- /src/imitation/regularization/__init__.py: -------------------------------------------------------------------------------- 1 | """Implements a variety of regularization techniques for NN weights.""" 2 | -------------------------------------------------------------------------------- /src/imitation/rewards/__init__.py: -------------------------------------------------------------------------------- 1 | """Reward models: neural network modules, serialization, preprocessing, etc.""" 2 | -------------------------------------------------------------------------------- /docs/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | .sidebar-container, .toc-drawer{ 2 | box-sizing:border-box; 3 | width:20em; 4 | } 5 | -------------------------------------------------------------------------------- /src/imitation/policies/__init__.py: -------------------------------------------------------------------------------- 1 | """Classes defining policies and methods to manipulate them (e.g. serialization).""" 2 | -------------------------------------------------------------------------------- /experiments/imit_table_mvp_seals_config.csv: -------------------------------------------------------------------------------- 1 | env_config_name,n_expert_demos 2 | seals_cartpole,40 3 | seals_mountain_car,40 4 | -------------------------------------------------------------------------------- /src/imitation/testing/__init__.py: -------------------------------------------------------------------------------- 1 | """Helper methods for unit tests. 2 | 3 | May also be useful for users of imitation. 4 | """ 5 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [report] 2 | exclude_lines = 3 | pragma: no cover 4 | @overload 5 | @typing.overload 6 | raise NotImplementedError 7 | -------------------------------------------------------------------------------- /tests/testdata/imit_benchmark_config.csv: -------------------------------------------------------------------------------- 1 | env_config_name,gen_batch_size,n_epochs,n_expert_demos 2 | seals_cartpole,10,3,1 3 | pendulum,10,3,1 4 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/base.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. auto{{ objtype }}:: {{ objname }} 6 | -------------------------------------------------------------------------------- /tests/testdata/expert_models/cartpole_0/rollouts/final.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanCompatibleAI/imitation/HEAD/tests/testdata/expert_models/cartpole_0/rollouts/final.npz -------------------------------------------------------------------------------- /tests/testdata/expert_models/pendulum_0/rollouts/final.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanCompatibleAI/imitation/HEAD/tests/testdata/expert_models/pendulum_0/rollouts/final.npz -------------------------------------------------------------------------------- /tests/testdata/npz_format_rollout.npz: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:87ba63200068de7128849e9dc29e50be2daaec805bff51aad06229a747a2e5d5 3 | size 247960 4 | -------------------------------------------------------------------------------- /tests/testdata/pickle_format_rollout.pkl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:89a8370f84db04078e736115be0774d20785334f81e9afc8252d1985e7de9f62 3 | size 15058 4 | -------------------------------------------------------------------------------- /tests/testdata/expert_models/cartpole_0/policies/final/model.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HumanCompatibleAI/imitation/HEAD/tests/testdata/expert_models/cartpole_0/policies/final/model.zip -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Description of changes and what issue this PR is solving. 4 | 5 | ## Testing 6 | 7 | Description of how you've tested your changes. 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ipynb linguist-vendored 2 | tests/testdata/pickle_format_rollout.pkl filter=lfs diff=lfs merge=lfs -text 3 | tests/testdata/npz_format_rollout.npz filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /src/imitation/data/__init__.py: -------------------------------------------------------------------------------- 1 | """Modules handling environment data. 2 | 3 | For example: types for transitions/trajectories; methods to compute rollouts; 4 | buffers to store transitions; helpers for these modules. 5 | """ 6 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | ignore_missing_imports = true 3 | exclude = output 4 | 5 | # torch had some type errors, we ignore them because they're not our fault 6 | [mypy-torch._dynamo.*] 7 | follow_imports = skip 8 | follow_imports_for_stubs = True 9 | -------------------------------------------------------------------------------- /docs/development/license.rst: -------------------------------------------------------------------------------- 1 | .. _License: 2 | 3 | License 4 | ======= 5 | 6 | This license is also available on the `project repository `_. 7 | 8 | .. include:: ../../LICENSE 9 | -------------------------------------------------------------------------------- /experiments/rollouts_from_policies_config.csv: -------------------------------------------------------------------------------- 1 | env_config_name,n_demonstrations 2 | seals_cartpole,40 3 | seals_mountain_car,40 4 | seals_half_cheetah,40 5 | seals_hopper,40 6 | seals_walker,40 7 | seals_swimmer,40 8 | seals_ant,40 9 | seals_humanoid,240 10 | -------------------------------------------------------------------------------- /src/imitation/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | """Command-line scripts.""" 2 | 3 | # Add our custom environments to Gym registry. 4 | 5 | try: 6 | # pytype: disable=import-error 7 | import seals # noqa: F401 8 | 9 | # pytype: enable=import-error 10 | except ImportError: 11 | pass 12 | -------------------------------------------------------------------------------- /ci/build_and_activate_venv.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | $venv 3 | ) 4 | $ErrorActionPreference = "Stop" # exit immediately on any error 5 | 6 | If ($venv -eq $null) { 7 | $venv = "venv" 8 | } 9 | 10 | virtualenv -p python3.9 $venv 11 | & $venv\Scripts\activate 12 | pip install ".[docs,parallel,test]" 13 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | configuration: docs/conf.py 5 | 6 | formats: all 7 | 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.8" 12 | 13 | python: 14 | install: 15 | - method: pip 16 | path: . 17 | extra_requirements: 18 | - docs 19 | -------------------------------------------------------------------------------- /docs/development/release-notes.rst: -------------------------------------------------------------------------------- 1 | Release Notes 2 | ============= 3 | 4 | .. changelog:: 5 | :changelog-url: https://imitation.readthedocs.io/en/latest/development/release-notes.html 6 | :github: https://github.com/HumanCompatibleAI/imitation/releases 7 | :pypi: https://pypi.org/project/imitation/ 8 | -------------------------------------------------------------------------------- /src/imitation/__init__.py: -------------------------------------------------------------------------------- 1 | """imitation: implementations of imitation and reward learning algorithms.""" 2 | 3 | from importlib import metadata 4 | 5 | try: 6 | __version__ = metadata.version("imitation") 7 | except metadata.PackageNotFoundError: # pragma: no cover 8 | # package is not installed 9 | pass 10 | -------------------------------------------------------------------------------- /tests/generate_test_data.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script regenerates tests/testdata. 3 | set -e 4 | 5 | # Regenerate tests/testdata/expert_models (for various tests). 6 | experiments/train_experts.sh -r 7 | 8 | mkdir -p tests/testdata/expert_models/cartpole_0/policies/final_without_vecnorm 9 | ln -sf ../final/model.zip tests/testdata/expert_models/cartpole_0/policies/final_without_vecnorm/model.zip 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Bug description 11 | Description of what the bug is. 12 | 13 | ## Steps to reproduce 14 | Code or a description of how to reproduce the bug. 15 | 16 | ## Environment 17 | - Operating system and version: 18 | - Python version: 19 | - Output of `pip freeze --all`: 20 | -------------------------------------------------------------------------------- /src/imitation/scripts/config/tuned_hps/fast_dagger_seals_cartpole.json: -------------------------------------------------------------------------------- 1 | { 2 | "bc": {"train_kwargs": {"n_batches": 50}}, 3 | "dagger": {"total_timesteps": 50}, 4 | "demonstrations": {"n_expert_demos": 10}, 5 | "policy_evaluation": {"n_episodes_eval": 50}, 6 | "environment": { 7 | "gym_id": "seals/CartPole-v0", 8 | "num_vec": 2, 9 | "parallel": false, 10 | "max_episode_steps": 5 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Problem 11 | Description of what problem this feature request aims to solve. 12 | 13 | ## Solution 14 | Description of proposed solution or change. 15 | 16 | ## Possible alternative solutions 17 | Description of any alternative solutions or features you've considered. 18 | -------------------------------------------------------------------------------- /CITATION.bib: -------------------------------------------------------------------------------- 1 | @misc{gleave2022imitation, 2 | author = {Gleave, Adam and Taufeeque, Mohammad and Rocamonde, Juan and Jenner, Erik and Wang, Steven H. and Toyer, Sam and Ernestus, Maximilian and Belrose, Nora and Emmons, Scott and Russell, Stuart}, 3 | title = {imitation: Clean Imitation Learning Implementations}, 4 | year = {2022}, 5 | howPublished = {arXiv:2211.11972v1 [cs.LG]}, 6 | archivePrefix = {arXiv}, 7 | eprint = {2211.11972}, 8 | primaryClass = {cs.LG}, 9 | url = {https://arxiv.org/abs/2211.11972}, 10 | } 11 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | 7 | {% block methods %} 8 | .. automethod:: __init__ 9 | 10 | {% if methods %} 11 | .. rubric:: {{ _('Methods') }} 12 | 13 | .. autosummary:: 14 | {% for item in methods %} 15 | ~{{ name }}.{{ item }} 16 | {%- endfor %} 17 | {% endif %} 18 | {% endblock %} 19 | 20 | {% block attributes %} 21 | {% if attributes %} 22 | .. rubric:: {{ _('Attributes') }} 23 | 24 | .. autosummary:: 25 | {% for item in attributes %} 26 | ~{{ name }}.{{ item }} 27 | {%- endfor %} 28 | {% endif %} 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /experiments/common.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Common variables for experiment scripts 4 | 5 | export GNU_DATE=date 6 | export GNU_GETOPT=getopt 7 | if [[ "$OSTYPE" == "darwin"* ]]; then 8 | export GNU_DATE=gdate 9 | if [[ $(uname -m) == 'arm64' ]]; then 10 | export GNU_GETOPT=/opt/homebrew/opt/gnu-getopt/bin/getopt 11 | else 12 | export GNU_GETOPT=/usr/local/opt/gnu-getopt/bin/getopt 13 | fi 14 | fi 15 | 16 | TIMESTAMP=$($GNU_DATE --iso-8601=seconds) 17 | export TIMESTAMP 18 | 19 | # Set OMP_NUM_THREADS=2 if not yet exported. 20 | # This is important because parallel runs of PyTorch often throttle due to 21 | # CPU contention unless this is set to a low number. 22 | export OMP_NUM_THREADS=${OMP_NUM_THREADS:-2} 23 | -------------------------------------------------------------------------------- /docs/development/contributing/index.rst: -------------------------------------------------------------------------------- 1 | .. _Contributing: 2 | 3 | Contributing 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :caption: Contributing 9 | :hidden: 10 | 11 | code-of-conduct 12 | ways-to-contribute 13 | 14 | Thank you for your interest in imitation! 15 | 16 | As an open-source project, we welcome contributions from all users, and are always open to any feedback or suggestions. This section of the documentation is intended to help you understand the process of contributing to the project. 17 | 18 | 19 | To keep the community open and inclusive, we have developed a :ref:`Code of Conduct `. If you are not 20 | familiar with our Code of Conduct, take a minute to read it before starting your first contribution. 21 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= -j auto -W 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | 22 | livehtml: 23 | sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) --open-browser 24 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | # Note: setuptools 66.1.1 is the last version that supports installing gym==0.21.0 3 | requires = ["setuptools==66.1.1", "setuptools_scm[toml]>=6.2"] 4 | build-backend = "setuptools.build_meta" 5 | 6 | # TODO(juan): we've commented this out because currently 7 | # there's no way (that we could find in the docs) to point 8 | # the local_scheme and version_scheme to a function from the 9 | # pyproject.toml file, so setup.py has to be used. 10 | # [tool.setuptools_scm] 11 | # # Disable local scheme to allow uploads to Test PyPI. 12 | # # See https://github.com/pypa/setuptools_scm/issues/342 13 | # local_scheme = "imitation.version:get_version" 14 | 15 | [tool.black] 16 | target-version = ["py38"] 17 | 18 | [tool.pytype] 19 | inputs = [ 20 | "src/", 21 | "tests/", 22 | "experiments/", 23 | "setup.py" 24 | ] 25 | python_version = "3.8" 26 | -------------------------------------------------------------------------------- /examples/quickstart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Train PPO agent on pendulum and collect expert demonstrations. Tensorboard logs saved in quickstart/rl/ 4 | python -m imitation.scripts.train_rl with pendulum environment.fast policy_evaluation.fast rl.fast fast logging.log_dir=quickstart/rl/ 5 | 6 | # Train GAIL from demonstrations. Tensorboard logs saved in output/ (default log directory). 7 | python -m imitation.scripts.train_adversarial gail with pendulum environment.fast demonstrations.fast policy_evaluation.fast rl.fast fast demonstrations.path=quickstart/rl/rollouts/final.npz demonstrations.source=local 8 | 9 | # Train AIRL from demonstrations. Tensorboard logs saved in output/ (default log directory). 10 | python -m imitation.scripts.train_adversarial airl with pendulum environment.fast demonstrations.fast policy_evaluation.fast rl.fast fast demonstrations.path=quickstart/rl/rollouts/final.npz demonstrations.source=local 11 | -------------------------------------------------------------------------------- /experiments/imit_benchmark_config.csv: -------------------------------------------------------------------------------- 1 | env_config_name,gen_batch_size,n_expert_demos 2 | seals_cartpole,5000,1 3 | seals_cartpole,5000,4 4 | seals_cartpole,5000,7 5 | seals_cartpole,5000,10 6 | seals_mountain_car,5000,1 7 | seals_mountain_car,5000,4 8 | seals_mountain_car,5000,7 9 | seals_mountain_car,5000,10 10 | seals_half_cheetah,50000,4 11 | seals_half_cheetah,50000,11 12 | seals_half_cheetah,50000,18 13 | seals_half_cheetah,50000,25 14 | seals_hopper,50000,4 15 | seals_hopper,50000,11 16 | seals_hopper,50000,18 17 | seals_hopper,50000,25 18 | seals_walker,50000,4 19 | seals_walker,50000,11 20 | seals_walker,50000,18 21 | seals_walker,50000,25 22 | seals_swimmer,50000,4 23 | seals_swimmer,50000,11 24 | seals_swimmer,50000,18 25 | seals_swimmer,50000,25 26 | seals_ant,50000,4 27 | seals_ant,50000,11 28 | seals_ant,50000,18 29 | seals_ant,50000,25 30 | seals_humanoid,50000,80 31 | seals_humanoid,50000,160 32 | seals_humanoid,50000,240 33 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: false 5 | main: 6 | paths: 7 | - "src/imitation/" 8 | - "!src/imitation/envs/examples/" 9 | - "!src/imitation/scripts/" 10 | auxiliary: 11 | target: 0% 12 | paths: 13 | - "src/imitation/envs/examples/" 14 | - "src/imitation/scripts/" 15 | tests: 16 | # Should not have dead code in our tests 17 | target: 100% 18 | paths: 19 | - "tests/" 20 | patch: 21 | default: false 22 | main: 23 | paths: 24 | - "src/imitation/" 25 | - "!src/imitation/envs/examples/" 26 | - "!src/imitation/scripts/" 27 | auxiliary: 28 | paths: 29 | - "examples/" 30 | - "src/imitation/envs/examples/" 31 | - "src/imitation/scripts/" 32 | - "!src/imitation/scripts/config" 33 | tests: 34 | target: 100% 35 | paths: 36 | - "tests/" 37 | -------------------------------------------------------------------------------- /benchmarking/run_benchmark_on_slurm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH --array=1-10 3 | # Avoid cluttering the root directory with log files: 4 | #SBATCH --output=slurm/%A_%a.out 5 | #SBATCH --cpus-per-task=8 6 | #SBATCH --gpus=0 7 | #SBATCH --mem=8gb 8 | #SBATCH --time=70:00:00 9 | #SBATCH --qos=scavenger 10 | 11 | # This script will run an imitation algorithm on an environment for 10 seeds. 12 | 13 | # This script assumes that you set up imitation in your NAS home directory and 14 | # installed it in a venv located in the imitation directory. 15 | 16 | # Call this script with