Warning
This repository is designed to be used with and
. However, both libraries have been significantly updated since this repository was last maintained, and there may be compatibility issues between the two codebases if using latest versions.
![]() |
![]() |
![]() |
pip install git+ssh://[email protected]/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.ipynbhow to easily create a dataset of mazes, utilities for filtering the generates mazes via properties, and basic visualizationtrain_model.ipynbconfiguration setup and training a basic modeleval_model.ipynbloading a trained model, and computing various metrics on its performance on a datasetplot_attention.ipynbvarious attention visualization utilitiesdemo_latticemaze.ipynbinternals of theLatticeMazeandSolvedMazeobjects, and advanced visualizationtrain_model_hallway.ipynbtraining a model on a customized dataset
-
Install Poetry
-
Install Python 3.10
- It's a good idea to use pyenv to manage python versions
- If using pyenv, you'll need to update your Poetry config for it to use the pyenv Python version:
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
- create a jupyter kernel with
poetry run ipython kernel install --user --name=maze-transformer - Restart VSCode
- In VSCode, select the python interpreter located in
maze-transformer/.venv/binas your juptyer kernel
- create a jupyter kernel with
make help will print all available commands.
-
all tests via
make test- unit tests via
make unit - integration tests via
make integration - notebook tests via
make test_notebooks
- unit tests via
-
formatter (black, pycln, and isort) via
make format- formatter in check-only mode via
make check-format
- formatter in check-only mode via
@software{maze_transformer,
author = {Michael I. Ivanitskiy and Alex F. Spies and Chris Mathwin and Dan Valentine and Can Rager and Guillaume Corlouer and Tilman Räuker and Rusheb Shah and Lucia Quirke},
title = {Maze-Transformer: A Package to Train and Analyze Transformers on Maze-Solving Tasks},
year = {2023},
url = {https://github.com/understanding-search/maze-transformer},
}


