How rsoumyadeep/activerl_gp works
1. This repository is a research codebase for active offline reinforcement learning using Gaussian Processes. It is centered around learning from a fixed offline dataset rather than interacting with an environment online.
2. The core model layer lives in three files:
- model_vgp.py
- model_vsvgp.py
- model_qsvgp.py
These are likely different GP-based model variants used for value/Q-function estimation and sparse variational approximations. This is the main architectural boundary of the repo: model definitions are separated from dataset handling, visualization, and experiment scripts.
3. The data layer is under data/, with a specific data/D4RL/ namespace and namespace_metadata.json. This strongly suggests the code consumes D4RL offline RL datasets, especially maze-style tasks. The repository is not built around live environment rollouts; it appears to train and evaluate on stored trajectories.
4. The saved artifacts live under saves/, including a checkpoint-like directory:
- saves/maze2d-umaze-v1_seed42_inducing15001
This indicates the workflow is: load dataset → train GP model → persist experiment outputs/checkpoints per environment/seed/settings. The save path encodes the environment, random seed, and inducing-point count, which are important experiment parameters.
5. Utility and support code is split out into:
- utils.py
- viz_utils.py
These likely contain shared helpers for preprocessing, numerical operations, plotting support, and experiment plumbing. They form the glue between the model code and the scripts.
6. Visualization is a distinct subsystem:
- visualize_maze_dataset.py
This script likely renders maze trajectories or dataset coverage for D4RL maze tasks. It suggests the repo includes an analysis/inspection workflow for understanding the offline dataset distribution, which matters in active offline RL.
7. The execution/experiment entry points appear to be the standalone scripts:
- test.py
- t2.py
- t4.py
- t5.py
- t6.py
These are probably iterative experiment drivers, ablation scripts, or prototype runs rather than a single unified training CLI. Architecturally, they sit above the model layer and orchestrate training/evaluation/plotting.
8. The likely data flow is:
- D4RL dataset files are loaded from data/
- preprocessing and experiment logic are handled via utils.py
- one of the GP model variants is instantiated and trained
- results are written to saves/
- visualization scripts read datasets or outputs for inspection
9. The main external dependency implied by the layout is D4RL, specifically maze2d tasks. That means the project’s architecture is shaped by offline RL benchmark data formats and benchmark-specific environment metadata rather than a general-purpose application backend.
10. The repository has a compact, experiment-oriented structure: models are isolated, data is vendored locally, and outputs are stored by experiment folder. There is no sign of a separate service layer, database, or frontend; the architecture is a single-machine scientific workflow with scripts as the orchestration boundary.
11. For an architecture diagram, the most important boxes are:
- offline D4RL maze dataset input
- GP model variants
- experiment/training scripts
- visualization scripts
- saved checkpoints/results
The arrows should show offline data flowing into preprocessing and model training, then into saved artifacts and visualization/evaluation.
Main entry points: data Dataset root · test.py Test runner · t2.py Run t2 · t4.py Run t4
Components 14
Offline data
Vendored D4RL maze datasets and namespace metadata.
- Dataset root · Local offline RL data inputs.
data - Namespace meta · Dataset namespace metadata for D4RL.
data/D4RL/namespace_metadata.json
GP models
Gaussian-process value and Q-function model variants.
- VGP model · Variational GP value-model variant.
model_vgp.py - VSVGP model · Sparse variational GP model variant.
model_vsvgp.py - QSVGP model · Sparse variational GP Q-function variant.
model_qsvgp.py
Experiment scripts
Standalone training, testing, and ablation entry points.
- Test runner · Primary test or evaluation entry point.
test.py - Run t2 · Standalone experiment driver.
t2.py - Run t4 · Standalone experiment driver.
t4.py - Run t5 · Standalone experiment driver.
t5.py - Run t6 · Standalone experiment driver.
t6.py - Maze viz · Offline maze dataset visualization entry point.
visualize_maze_dataset.py
Support code
Shared utilities and visualization helpers.
Saved outputs
Per-run checkpoints and experiment artifacts.
- Saved runs · Checkpoint and result directories keyed by experiment settings.
saves
Connections 35
- Dataset root → Namespace meta: namespaces · Dataset organization and metadata.
- Namespace meta → Test runner: configures · Run metadata informs experiment setup.
- Namespace meta → Run t2: configures · Run metadata informs experiment setup.
- Namespace meta → Run t4: configures · Run metadata informs experiment setup.
- Namespace meta → Run t5: configures · Run metadata informs experiment setup.
- Namespace meta → Run t6: configures · Run metadata informs experiment setup.
- Dataset root → Test runner: loads · Offline trajectories are consumed by experiment scripts.
- Dataset root → Run t2: loads · Offline trajectories are consumed by experiment scripts.
- Dataset root → Run t4: loads · Offline trajectories are consumed by experiment scripts.
- Dataset root → Run t5: loads · Offline trajectories are consumed by experiment scripts.
- Dataset root → Run t6: loads · Offline trajectories are consumed by experiment scripts.
- Test runner → Utils: uses · Shared preprocessing and training helpers.
- Run t2 → Utils: uses · Shared preprocessing and training helpers.
- Run t4 → Utils: uses · Shared preprocessing and training helpers.
- Run t5 → Utils: uses · Shared preprocessing and training helpers.
- Run t6 → Utils: uses · Shared preprocessing and training helpers.
- Test runner → VGP model: trains · Evaluation or training entry point for the GP model layer.
- Test runner → VSVGP model: trains · Evaluation or training entry point for the GP model layer.
- Test runner → QSVGP model: trains · Evaluation or training entry point for the GP model layer.
- Run t2 → VGP model: trains · Experiment drivers instantiate GP variants.
- Run t2 → VSVGP model: trains · Experiment drivers instantiate GP variants.
- Run t2 → QSVGP model: trains · Experiment drivers instantiate GP variants.
- Run t4 → VGP model: trains · Experiment drivers instantiate GP variants.
- Run t4 → VSVGP model: trains · Experiment drivers instantiate GP variants.
- Run t4 → QSVGP model: trains · Experiment drivers instantiate GP variants.
- Maze viz → Viz utils: uses · Visualization-specific helper routines.
- Maze viz → Dataset root: inspects · Plots maze dataset coverage and trajectories.
- VGP model → Saved runs: writes · Model checkpoints and outputs are persisted per run.
- VSVGP model → Saved runs: writes · Model checkpoints and outputs are persisted per run.
- QSVGP model → Saved runs: writes · Model checkpoints and outputs are persisted per run.
- Test runner → Saved runs: reads/writes · Experiment scripts consume and emit saved artifacts.
- Run t2 → Saved runs: reads/writes · Experiment scripts consume and emit saved artifacts.
- Run t4 → Saved runs: reads/writes · Experiment scripts consume and emit saved artifacts.
- Run t5 → Saved runs: reads/writes · Experiment scripts consume and emit saved artifacts.
- Run t6 → Saved runs: reads/writes · Experiment scripts consume and emit saved artifacts.