This repo is built to facilitate the training and analysis of autoregressive transformers on maze-solving tasks.
pip install git+ssh://git@github.com/understanding-search/maze-transformer.git
Note: if you want to install the library in colab, follow the steps in this Colab notebook.
You can run all tests via
make test
(this will take a few minutes)
Most of the functionality is demonstrated in the ipython notebooks in the notebooks/
folder.
demo_dataset.ipynb
how to easily create a dataset of mazes, utilities for filtering the generates mazes via properties, and basic visualizationtrain_model.ipynb
configuration setup and training a basic modeleval_model.ipynb
loading a trained model, and computing various metrics on its performance on a datasetplot_attention.ipynb
various attention visualization utilitiesdemo_latticemaze.ipynb
internals of the LatticeMaze
and SolvedMaze
objects, and advanced visualizationtrain_model_hallway.ipynb
training a model on a customized datasetInstall Poetry
Install Python 3.10
poetry config virtualenvs.prefer-active-python true
Install dev dependencies
poetry config virtualenvs.in-project true
poetry install --with dev
Run unit, integration, and notebook tests
make test
(Optional) If you want to work with the jupyter notebooks in VSCode
poetry run ipython kernel install --user --name=maze-transformer
maze-transformer/.venv/bin
as your juptyer kernelmake help
will print all available commands.
all tests via make test
make unit
make integration
make test_notebooks
formatter (black, pycln, and isort) via make format
make check-format