Practical overview
When it fits
Use the repository when you want code and experiment scripts for training and evaluating BabyAI agents from synthetic thought demonstrations.
Who it is for
- AI researchers studying imitation learning and agent reasoning
- Developers reproducing the repository's BabyAI training and evaluation experiments
Documented uses
- Generate synthetic thought demonstrations for a selected environment.
- Train a Thought Cloning model on BabyAI demonstrations.
- Evaluate a trained model on out-of-distribution BabyAI levels.
- Explore adaptations to another partially observable task, accounting for required integration and validation.
Requirements & limits
The repository is public and lists an MIT license. Its documented setup is local Python installation.
- The included environment is BabyAI's partially observable 2D gridworld.
- The README specifies older versions of Gym, NumPy and gym-minigrid and warns that higher versions may be incompatible.
- BossLevel demonstrations, trained weights and out-of-distribution testing environments are linked for reproducing experiments.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the Thought Cloning Python environment
Create the documented virtual environment, install the project and configure its output directory.
Before you start
- Python 3.6 or later
- PyTorch 1.7.1 or later
- OpenAI Gym 0.9.6
- NumPy 1.19.5
- gym-minigrid 1.0.0
Steps
Create and activate a virtual environment using python-venv or conda.
Install PyTorch 1.7.1 or later using the PyTorch installation instructions.
Clone the repository, enter its directory, upgrade pip and install the project in editable mode with pip3.
Set the output directory in storage_dir in babyai/utils/__init__.py to the path of the project.
Expected outcome
A configured local installation of the repository, ready for its documented experiment scripts.
Guide limitations
- The README warns that higher versions of Gym, NumPy or gym-minigrid may not be compatible.
- If the project directory is moved after installation, the README says to run the editable install command again.
Generate a synthetic thought-demonstration dataset
Use the repository's demonstration-generation script to create synthetic demonstrations for a specified environment.
Before you start
- The repository installed in a Python environment with the documented dependencies
- A chosen episode count and environment name
Steps
Run scripts/make_agent_demos.py with --episodes, --env and --noise-rate 0.01.
Provide the desired episode count and environment name for the placeholder values.
Expected outcome
A synthetic thought dataset generated by the repository's demonstration script.
Guide limitations
- The README provides the command pattern but does not specify an output path or detail the generated files.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- ShengranHu/Thought-Cloning · Official homepage title · retained in its source language

