Meta-Optimization Using Sequential Experiences — experiment runner
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mouse_experiment-0.1.0.tar.gz.
File metadata
- Download URL: mouse_experiment-0.1.0.tar.gz
- Upload date:
- Size: 57.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6b54bdad28644228753d22efd3e77d23838a6f71b4a1a28b784e256a24923e0
|
|
| MD5 |
dcf79f16b08567841983d7d3af0e120a
|
|
| BLAKE2b-256 |
8899c562bbe73425ce58ab38c102c996ff816573701e9fd0045830d3f60dd394
|
Provenance
The following attestation bundles were made for mouse_experiment-0.1.0.tar.gz:
Publisher:
publish.yml on micahr234/mouse-experiment
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mouse_experiment-0.1.0.tar.gz -
Subject digest:
d6b54bdad28644228753d22efd3e77d23838a6f71b4a1a28b784e256a24923e0 - Sigstore transparency entry: 1612092597
- Sigstore integration time:
-
Permalink:
micahr234/mouse-experiment@16c415558cbc6b758e467128dff5d834dde6e2c8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/micahr234
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16c415558cbc6b758e467128dff5d834dde6e2c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mouse_experiment-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mouse_experiment-0.1.0-py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e7689cec50a8f4fef4f3aff122222afde4a677f3b84905581ab84926067e4dd
|
|
| MD5 |
e3651ab14a74ea7c6ba0b64cb23e694e
|
|
| BLAKE2b-256 |
91476d069d736e0e8ac6a5db15fd103c9dafd9922e48ae30e63e76ec2577c42d
|
Provenance
The following attestation bundles were made for mouse_experiment-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on micahr234/mouse-experiment
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mouse_experiment-0.1.0-py3-none-any.whl -
Subject digest:
0e7689cec50a8f4fef4f3aff122222afde4a677f3b84905581ab84926067e4dd - Sigstore transparency entry: 1612092688
- Sigstore integration time:
-
Permalink:
micahr234/mouse-experiment@16c415558cbc6b758e467128dff5d834dde6e2c8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/micahr234
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16c415558cbc6b758e467128dff5d834dde6e2c8 -
Trigger Event:
push
-
Statement type: