Official code for "The Yōkai Learning Environment: Tracking Beliefs Over Space and Time".
Find a file
2026-05-03 13:39:16 +02:00
jaxmarl Init 2026-05-03 13:27:37 +02:00
src Chore: Clean up 2026-05-03 13:39:16 +02:00
.gitignore Init 2026-05-03 13:27:37 +02:00
.pylintrc Init 2026-05-03 13:27:37 +02:00
.python-version Init 2026-05-03 13:27:37 +02:00
Dockerfile Init 2026-05-03 13:27:37 +02:00
LICENSE Init 2026-05-03 13:27:37 +02:00
plot_xp_matrix.sh Init 2026-05-03 13:27:37 +02:00
pyproject.toml Init 2026-05-03 13:27:37 +02:00
README.md Init 2026-05-03 13:27:37 +02:00
uv.lock Init 2026-05-03 13:27:37 +02:00

The Yokai Learning Environment

This repository implements the Yokai Learning Environment (YLE) based on the cooperative card game Yokai. It accompanies our paper "The Yokai Learning Environment: Tracking Beliefs Over Space and Time".

Organisation

We add our implementation to the JaxMARL project but we do not follow their repository organisation. While the environment is colocated with all other JaxMARL environments our training and evaluation code can be found in src and not in baselines. We give an overview over the most important aspects of the code here:

.
jaxmarl/
|-- ...
|-- environments/
    |-- ...
    |-- yokai/
        |-- __init__.py             # Exports are handeld here
        |-- constants.py            # Helper functions
        |-- yokai_grid.py           # The yokai environment
src/                                # Training and evaluation functions

Environment Versions

We provide two Yokai versions. The one explored in the paper is available under the configuration name yokai_grid_9_game. All versions are yokai_grid_9_game and yokai_grid_16_game. First, yokai_grid_9_game implements the 9 card version in the 9x9 grid. Second, yokai_grid_16_game implements the 16 card version in a 10x10 grid. The two versions can be found at the bottom of the jaxmarl/environments/yokai/yokai_grid.py file.

Training, Evaluation and Reproducability

Running a training itself is easy and boils down to setting the run parameters correctly (refer to the config class in train_*.py). The config already sets reasonable defaults. A example command would be:

CUDA_VISIBLE_DEVICES=${device} python3 -m src/train_*.py

Credit

The implementation is based on several projects:

  1. Most importantly, this work is based on the JaxMARL project. The YLE follows its provided interface.
  2. Our TransformerXL implementation is based on the transformerXL_PPO_JAX project.
  3. The code for running sweeps is mostly from the Sampling for Learnability project.