RatInABox — Lab Training

Learn to use RatInABox python library for neural synthetic-data generation.

A hands-on guide to the RatInABox library, built around one concrete goal: generating synthetic training data for computational cognitive neuroscience projects. Each module is a single runnable notebook: a written walk-through, then a set of problems to work. The answers live in the module too, folded away, so you can reveal them whenever you’re stuck or want to check your work.

Pick a Setup Path

There are two ways to run these modules: in Google Colab, or in your own local environment. Instructions for both are below.

Google Colab · zero setup

Open a module’s practice notebook in Google Colab with the button in the module table below. The notebook already includes the pip install step, so there’s nothing to configure. Compute and session time are capped by Google, but it’s the fastest way in.

(Each module links straight to Colab — no manual download or upload needed.)

Local env through Pixi

For reproducible synthetic-data generation, use the pinned environment below.

TipLocal env prerequisite

Before running these commands you must have pixi installed on your computer.

pixi install       # Scientific libraries
pixi run verify    # sanity-check the install
pixi run lab       # open local JupyterLab
# For notebooks that require pytorch
pixi install -e dl && pixi run -e dl lab

Learning Modules

Each module is one notebook where we work through some major facet of the RiAB lib. Answers for problems located in modules are folded to be hidden and a practice notebook is included which has only boilerplate code and problems without answers. Lastly, modules build on each other, so it’s best to work them in order.

# Module What you get out of it Practice notebook
1 Environments & Agents Build worlds and drive a realistic simulated animal Colab Download
2 Place cells (CA1 input) (coming soon) Single-location place codes and rate maps
3 Head direction & the cell zoo (coming soon) HD + angular-velocity inputs
4 Mazes, spikes & extraction (coming soon) Structured geometry, Poisson spikes, dataset assembly
5 Synthetic-data pipeline (coming soon) Towards a realistic generator for an RNN