This codebase implements a framework for bilevel planning with learned neuro-symbolic relational abstractions, as described in the following papers:
The codebase is still under active development. Please contact tslvr@mit.edu or njk@mit.edu before attempting to use it for your own research.
In predicators/
, the environments are defined in the envs/
directory, and the approaches (both learning-based and not) are defined in the approaches/
directory. The core NSRT learning algorithm happens in predicators/nsrt_learning/nsrt_learning_main.py
, which has the following steps:
Methods for predicate learning are implemented as Approaches (e.g., predicators/approaches/grammar_search_invention_approach.py
), and may interface with the core structure of predicators/nsrt_learning/nsrt_learning_main.py
in various ways.
A simple implementation of search-then-sample bilevel planning is provided in predicators/planning.py
. This implementation uses the "SeSamE" strategy: SEarch-and-SAMple planning, then Execution.
pip install -e .
to install dependencies.PYTHONHASHSEED
Our code assumes that python hashing is deterministic between processes, which is not true by default.
Please make sure to export PYTHONHASHSEED=0
when running the code. You can add this line to your bash profile, or prepend export PYTHONHASHSEED=0
to any command line call, e.g., export PYTHONHASHSEED=0 python predicators/main.py --env ...
.
python predicators/main.py --env cover --approach oracle --seed 0
to run the system.See these instructions.
pip install -e .[develop]
to install all dependencies for development..github/workflows/predicators.yml
, which you can run locally in one line via ./scripts/run_checks.sh
, or individually as follows:
pytest -s tests/ --cov-config=.coveragerc --cov=predicators/ --cov=tests/ --cov-fail-under=100 --cov-report=term-missing:skip-covered --durations=0
mypy . --config-file mypy.ini
pytest . --pylint -m pylint --pylint-rcfile=.predicators_pylintrc
./run_autoformat.sh
mypy -p predicators --config-file predicators/mypy.ini
from one directory up..predicators_pylintrc
in the root of this repository. Feel free to edit this file as necessary..style.yapf
and .isort.cfg
in the root of this repository.