Meta-Optimization Using Sequential Experiences
Warning: MOUSE is in early development and is not yet ready for use. APIs will change without notice.
mouse-experiment is the experiment runner for MOUSE, a modular PyTorch stack for in-context reinforcement learning. It provides YAML-driven configuration, offline training, online test rollouts, and logging to both Weights & Biases and Trackio.
For the core ML library, see mouse-core. For NS-Gym environments, see mouse-env.
Install
pip install mouse-experiment
Development:
git clone https://github.com/micahr234/mouse-experiment.git
cd mouse-experiment
source scripts/install.sh
Quick start
Each experiment is described by a single YAML file. A fully-annotated reference config is at configs/ns_gym/default.yaml.
# Activate environment
source .venv/bin/activate
# Run an experiment (full path or relative to configs/)
mouse-run configs/ns_gym/cartpole/train_ns_cartpole_with_bb.yaml
# Or via the tmux wrapper
./scripts/run.sh configs/ns_gym/cartpole/train_ns_cartpole_with_bb.yaml
Set the following environment variables before running:
| Variable | Required | Purpose |
|---|---|---|
HF_TOKEN |
Yes | Hugging Face token for dataset and model push/pull |
WANDB_TOKEN |
Yes | Weights & Biases API key |
TRACKIO_SPACE_ID |
No | HF Space to sync Trackio dashboard to (e.g. user/my-space) |
Experiment YAML structure
seed: 42
# ── Datasets ──────────────────────────────────────────────────────────────
load_train_dataset:
name: play_ns_cartpole_big # HF dataset id or local path
split: train
load_eval_datasets:
- name: play_ns_cartpole_big
split: eval
tag: id
save_dataset:
name: my_rollout_dataset # HF dataset to push rollouts to (null = skip)
# ── Model ─────────────────────────────────────────────────────────────────
model:
backbone:
type: llama # llama | qwen3 | none
load_config: meta-llama/Llama-3.2-1B
load_pretrained_name: meta-llama/Llama-3.2-1B
num_layers: 4
vec_dqn_head:
vec_dim: 2
# ── Training loop ─────────────────────────────────────────────────────────
loop:
num_steps: 50000
train_interval: 1
eval_interval: 100
test_interval: 1000
lr: 1.0e-5
# ── Online test environments ───────────────────────────────────────────────
test_envs:
cartpole_ns:
id: NS-CartPole-v1
num_envs: 10
num_steps: 500
action_source:
name: learned_vec_dqn
# ── Logging ───────────────────────────────────────────────────────────────
wandb:
project: "Train NS-Gym"
run_name: null # auto-generated from config filename if null
trackio:
project: "Train NS-Gym" # omit or set null to disable Trackio
space_id: null # e.g. "user/mouse-dashboard"
See configs/ns_gym/default.yaml for every available setting with inline documentation.
Experiment modes
| Mode | train_interval |
What it does |
|---|---|---|
| Play (collect data) | 0 |
Runs test rollouts with expert q_star actions, saves trajectories to HF Hub |
| Train | > 0 |
Loads a prior play dataset, trains offline, runs periodic eval + online rollouts |
Logging
Every run logs to:
- Weights & Biases — always. Project is set via
wandb.projectin the config. - Trackio — when
trackio.projectis set. Metrics are stored locally in SQLite and optionally synced to a Hugging Face Space (viatrackio.space_idor theTRACKIO_SPACE_IDenv var).
Pre-built configs
| Config | Environment | Mode |
|---|---|---|
configs/ns_gym/cartpole/play_ns_cartpole.yaml |
NS-CartPole-v1 | play |
configs/ns_gym/cartpole/train_ns_cartpole_with_bb.yaml |
NS-CartPole-v1 | train (Llama backbone) |
configs/ns_gym/cartpole/train_ns_cartpole_without_bb.yaml |
NS-CartPole-v1 | train (no backbone) |
configs/ns_gym/frozenlake/train_ns_frozenlake_with_bb.yaml |
NS-FrozenLake-v1 | train (Llama backbone) |
Contributing
See CONTRIBUTING.md.
License
GNU General Public License v3.0 — see LICENSE.
Metadata
Release files for mouse-experiment 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mouse_experiment-0.1.0.tar.gz | 57.5 kB | With provenance | Details for mouse_experiment-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mouse_experiment-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mouse_experiment-0.1.0-py3-none-any.whl |
Total release size: 115.9 kB
Release files / mouse_experiment-0.1.0.tar.gz
| Download URL | mouse_experiment-0.1.0.tar.gz |
|---|---|
| Size | 57.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6b54bdad28644228753d22efd3e77d23838a6f71b4a1a28b784e256a24923e0
|
|
BLAKE2b-256 checksum How to use checksums |
8899c562bbe73425ce58ab38c102c996ff816573701e9fd0045830d3f60dd394
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 23, 2026.
Transparency logRelease files / mouse_experiment-0.1.0-py3-none-any.whl
| Download URL | mouse_experiment-0.1.0-py3-none-any.whl |
|---|---|
| Size | 58.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e7689cec50a8f4fef4f3aff122222afde4a677f3b84905581ab84926067e4dd
|
|
BLAKE2b-256 checksum How to use checksums |
91476d069d736e0e8ac6a5db15fd103c9dafd9922e48ae30e63e76ec2577c42d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 23, 2026.
Transparency logSecurity for mouse-experiment 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mouse_experiment-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.